Add versioning to MSI installer.

Also close console window when not using CLI.

Remove deployment section of appveyor.yml for the time being.
This commit is contained in:
Kevin Cathcart 2017-12-02 09:21:04 -05:00
parent 793eaeed65
commit c760ac1766
4 changed files with 16 additions and 11 deletions

View File

@ -7,7 +7,7 @@ import sys
from Main import main
from Gui import guiMain
from Utils import is_bundled
from Utils import is_bundled, close_console
class ArgumentDefaultsHelpFormatter(argparse.RawTextHelpFormatter):
@ -196,6 +196,7 @@ if __name__ == '__main__':
# probably wants the gui. Users of the bundled build who want the command line
# interface shouuld specify at least one option, possibly setting a value to a
# default if they like all the defaults
close_console()
guiMain()
sys.exit(0)

View File

@ -62,3 +62,12 @@ def open_file(filename):
else:
open_Command = 'open' if sys.platform == 'darwin' else 'xdg-open'
subprocess.call([open_command, filename])
def close_console():
if sys.platform == 'win32':
#windows
import ctypes.wintypes
try:
ctypes.windll.kernel32.FreeConsole()
except:
pass

View File

@ -16,6 +16,7 @@ install:
- 'move dist\EntranceRandomizer\*.pyd dist\EntranceRandomizer\ext'
- 'move dist\EntranceRandomizer\tcl*.dll dist\EntranceRandomizer\ext'
- 'move dist\EntranceRandomizer\tk*.dll dist\EntranceRandomizer\ext'
- ps: '$env:ER_Version= &"$env:PYTHON\python.exe" -c "import Main; import re; print(re.match(''[0-9]+\\.[0-9]+\\.[0-9]+'',Main.__version__).group(0))"'
- '"%WIX%\bin\heat.exe" dir "dist\EntranceRandomizer" -sfrag -srd -suid -dr INSTALLDIR -cg ERFiles -ag -template fragment -t bundle\components.xslt -out build\components.wxs'
- '"%WIX%\bin\candle.exe" -out build\ bundle\*.wxs build\*.wxs'
- '"%WIX%\bin\light.exe" -ext WixUIExtension build\*.wixobj -o dist\EntranceRandomizer-Installer-%ProjectVersion%-win32.msi -b dist\EntranceRandomizer'
@ -25,12 +26,3 @@ artifacts:
name: EntranceRandomizer-Installer-$(ProjectVersion)-win32.msi
- path: dist/EntranceRandomizer/
name: EntranceRandomizer-Raw-$(ProjectVersion)-win32.zip
deploy:
- provider: GitHub
tag: $(APPVEYOR_REPO_TAG_NAME)
auth_token:
secure: wQH+KnogyjYcDdo/srOQeoYEVIbH1uoYA5Iajdy/sR0Tbme7gOt15u2FBIkTg9/x
artifact: /.*-win32.*/
force_update: false
on:
appveyor_repo_tag: true

View File

@ -1,7 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="ALttP Entrance Randomizer" Language="1033" Version="0.5.0" Manufacturer="Randomizer Community" UpgradeCode="0229C621-5F8A-4D59-962A-5826C58B93DD" >
<!-- Setting the product ID to "*" means all upgrades are treated as major upgrades, and will uninstall the old version
before installing the new one. This is desireable because it means nothing breaks if we fail to follow the component rules precisely. -->
<Product Id="*" Name="ALttP Entrance Randomizer" Language="1033" Version="$(env.ER_Version)" Manufacturer="Randomizer Community" UpgradeCode="0229C621-5F8A-4D59-962A-5826C58B93DD" >
<Package Id="*" InstallerVersion="400" Compressed="yes" InstallScope="perMachine" />
<!-- Allowing downgrades will cause a harmless warning to be emitted. This wearning is not relevant here, allowing downgrades via a new major upgrade is safe for a simple standalone app like this-->
<MajorUpgrade AllowDowngrades="yes"/>
<Media Id="1" Cabinet="contents.cab" EmbedCab="yes" CompressionLevel="high"/>
<Directory Id="TARGETDIR" Name="SourceDir">