mirror of
https://github.com/blw1138/Zordon.git
synced 2025-12-17 08:48:13 +00:00
Update main.spec to include version numbers on Windows
This commit is contained in:
54
main.spec
54
main.spec
@@ -6,7 +6,7 @@ import os
|
|||||||
import sys
|
import sys
|
||||||
import platform
|
import platform
|
||||||
sys.path.insert(0, os.path.abspath('.'))
|
sys.path.insert(0, os.path.abspath('.'))
|
||||||
from version import APP_NAME, APP_VERSION
|
from version import APP_NAME, APP_VERSION, APP_AUTHOR
|
||||||
|
|
||||||
datas = [('resources', 'resources'), ('src/engines/blender/scripts/', 'src/engines/blender/scripts')]
|
datas = [('resources', 'resources'), ('src/engines/blender/scripts/', 'src/engines/blender/scripts')]
|
||||||
binaries = []
|
binaries = []
|
||||||
@@ -30,7 +30,8 @@ a = Analysis(
|
|||||||
)
|
)
|
||||||
pyz = PYZ(a.pure)
|
pyz = PYZ(a.pure)
|
||||||
|
|
||||||
if platform.system() == 'Darwin':
|
if platform.system() == 'Darwin': # macOS
|
||||||
|
|
||||||
exe = EXE(
|
exe = EXE(
|
||||||
pyz,
|
pyz,
|
||||||
a.scripts,
|
a.scripts,
|
||||||
@@ -48,23 +49,35 @@ if platform.system() == 'Darwin':
|
|||||||
codesign_identity=None,
|
codesign_identity=None,
|
||||||
entitlements_file=None,
|
entitlements_file=None,
|
||||||
)
|
)
|
||||||
coll = COLLECT(
|
app = BUNDLE(
|
||||||
exe,
|
exe,
|
||||||
a.binaries,
|
a.binaries,
|
||||||
a.datas,
|
a.datas,
|
||||||
strip=True,
|
strip=True,
|
||||||
upx=True,
|
|
||||||
upx_exclude=[],
|
|
||||||
name=APP_NAME,
|
|
||||||
)
|
|
||||||
app = BUNDLE(
|
|
||||||
coll,
|
|
||||||
name=f'{APP_NAME}.app',
|
name=f'{APP_NAME}.app',
|
||||||
icon=None,
|
icon=None,
|
||||||
bundle_identifier=None,
|
bundle_identifier=None,
|
||||||
version=APP_VERSION
|
version=APP_VERSION
|
||||||
)
|
)
|
||||||
else:
|
|
||||||
|
elif platform.system() == 'Windows':
|
||||||
|
|
||||||
|
import pyinstaller_versionfile
|
||||||
|
import tempfile
|
||||||
|
|
||||||
|
version_file_path = os.path.join(tempfile.gettempdir(), 'versionfile.txt')
|
||||||
|
|
||||||
|
pyinstaller_versionfile.create_versionfile(
|
||||||
|
output_file=version_file_path,
|
||||||
|
version=APP_VERSION,
|
||||||
|
company_name=APP_AUTHOR,
|
||||||
|
file_description=APP_NAME,
|
||||||
|
internal_name=APP_NAME,
|
||||||
|
legal_copyright=f"© {APP_AUTHOR}",
|
||||||
|
original_filename=f"{APP_NAME}.exe",
|
||||||
|
product_name=APP_NAME
|
||||||
|
)
|
||||||
|
|
||||||
exe = EXE(
|
exe = EXE(
|
||||||
pyz,
|
pyz,
|
||||||
a.scripts,
|
a.scripts,
|
||||||
@@ -82,4 +95,25 @@ else:
|
|||||||
target_arch=None,
|
target_arch=None,
|
||||||
codesign_identity=None,
|
codesign_identity=None,
|
||||||
entitlements_file=None,
|
entitlements_file=None,
|
||||||
|
version=version_file_path
|
||||||
|
)
|
||||||
|
|
||||||
|
else: # linux
|
||||||
|
exe = EXE(
|
||||||
|
pyz,
|
||||||
|
a.scripts,
|
||||||
|
a.binaries,
|
||||||
|
a.datas,
|
||||||
|
[],
|
||||||
|
name=APP_NAME,
|
||||||
|
debug=False,
|
||||||
|
bootloader_ignore_signals=False,
|
||||||
|
strip=False,
|
||||||
|
upx=True,
|
||||||
|
console=False,
|
||||||
|
disable_windowed_traceback=False,
|
||||||
|
argv_emulation=False,
|
||||||
|
target_arch=None,
|
||||||
|
codesign_identity=None,
|
||||||
|
entitlements_file=None
|
||||||
)
|
)
|
||||||
@@ -1,2 +1,3 @@
|
|||||||
APP_NAME = "Zordon"
|
APP_NAME = "Zordon"
|
||||||
APP_VERSION = "0.0.1"
|
APP_VERSION = "0.0.1"
|
||||||
|
APP_AUTHOR = "Brett Williams"
|
||||||
|
|||||||
Reference in New Issue
Block a user