From c760ac1766f2032ee1685eda6e91770fbf29d3d4 Mon Sep 17 00:00:00 2001 From: Kevin Cathcart Date: Sat, 2 Dec 2017 09:21:04 -0500 Subject: [PATCH] Add versioning to MSI installer. Also close console window when not using CLI. Remove deployment section of appveyor.yml for the time being. --- EntranceRandomizer.py | 3 ++- Utils.py | 9 +++++++++ appveyor.yml | 10 +--------- bundle/installer.wxs | 5 ++++- 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/EntranceRandomizer.py b/EntranceRandomizer.py index 7b195486..f44dee52 100644 --- a/EntranceRandomizer.py +++ b/EntranceRandomizer.py @@ -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) diff --git a/Utils.py b/Utils.py index cfc53aa0..30703287 100644 --- a/Utils.py +++ b/Utils.py @@ -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 diff --git a/appveyor.yml b/appveyor.yml index 3d9ebe17..a36537ac 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -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 diff --git a/bundle/installer.wxs b/bundle/installer.wxs index c6ef2185..f5d111d7 100644 --- a/bundle/installer.wxs +++ b/bundle/installer.wxs @@ -1,7 +1,10 @@ - + + +