From 9733a61f41cd4f11f5f3966694b9464c7749defc Mon Sep 17 00:00:00 2001 From: Dummerle Date: Thu, 2 Sep 2021 23:38:11 +0200 Subject: [PATCH] Update version and freeze.py --- freeze.py | 99 +++++++++++++++++++++++++++++++++++------------- rare/__init__.py | 2 +- 2 files changed, 73 insertions(+), 28 deletions(-) diff --git a/freeze.py b/freeze.py index a9c555d0..34c11b58 100644 --- a/freeze.py +++ b/freeze.py @@ -1,37 +1,82 @@ +import sys + from cx_Freeze import setup, Executable from rare import __version__ -# Dependencies are automatically detected, but it might need fine tuning. -# "packages": ["os"] is used as example only - -requirements = [ - "requests", - "PIL", - "setuptools", - "wheel", +# Packages to include +python_packages = [ "PyQt5", - "qtawesome", - "psutil", - "pypresence", + 'requests', + 'PIL', + 'qtawesome', + 'psutil', + 'pypresence', 'win32com' ] -bdist_msi_options = { - 'add_to_path': False, - 'initial_target_dir': r'[ProgramFilesFolder]\%s' % "Rare", -} -build_exe_options = {"includes": requirements, "excludes": ["tkinter", "setuptools"]} +# Modules to include +python_modules = [] -base = "Win32GUI" +base = None +name = None +build_options = {} +build_exe_options = {} +shortcutName = None +shortcutDir = None +bdist_msi_options = None +src_files = [] +external_so_files = [] -setup( - name="Rare", - version=__version__, - description="A GUI for Legendary", - options={"build_exe": build_exe_options}, - shortcutName="Rare", - shortcutDir="DesktopFolder", - executables=[Executable("rare/Rare.py", # no __main__.py, for gh release - base=base, icon="rare/resources/images/Rare.ico")] -) +if sys.platform == 'win32': + base = 'Win32GUI' + name = 'Rare.exe' + shortcut_table = [ + ('DesktopShortcut', # Shortcut + 'DesktopFolder', # Directory + 'Rare', # Name + 'TARGETDIR', # Component + '[TARGETDIR]' + name, # Target + None, # Arguments + 'A gui for Legendary.', # Description + None, # Hotkey + None, # Icon + None, # IconIndex + None, # ShowCmd + 'TARGETDIR' # Working Directory + )] + msi_data = {"Shortcut": shortcut_table} + bdist_msi_options = {'data': msi_data, "all_users": False} + build_options["bdist_msi"] = bdist_msi_options +else: + name = 'Rare' + +src_files += [ + 'LICENSE', + 'README.md', + 'rare/resources/images/Rare.ico', +] + +# Dependencies are automatically detected, but it might need fine tuning. +build_exe_options["packages"] = python_packages +build_exe_options["include_files"] = src_files + external_so_files +build_exe_options["includes"] = python_modules +build_exe_options["excludes"] = ["setuptools", "tkinter", "pkg_resources"] + +# Set options +build_options["build_exe"] = build_exe_options + +setup(name='Rare', + version=__version__, + description='A gui for Legendary.', + options=build_options, + executables=[ + Executable('rare/Rare.py', + targetName=name, + icon='rare/resources/images/Rare.ico', + base=base, + shortcutName=shortcutName, + shortcutDir=shortcutDir, + ), + ], + ) diff --git a/rare/__init__.py b/rare/__init__.py index 7e157a8c..eccea8f5 100644 --- a/rare/__init__.py +++ b/rare/__init__.py @@ -1,6 +1,6 @@ import os -__version__ = "1.6.0" +__version__ = "1.6.2" resources_path = os.path.join(os.path.dirname(__file__), "resources") languages_path = os.path.join(os.path.dirname(__file__), "languages")