78 lines
2.0 KiB
Python
78 lines
2.0 KiB
Python
# -*- mode: python ; coding: utf-8 -*-
|
|
import shutil
|
|
from pathlib import Path
|
|
|
|
|
|
a = Analysis(
|
|
['Toby Doom Launcher.py'],
|
|
pathex=[],
|
|
binaries=[],
|
|
datas=[
|
|
('TobyCustom', 'TobyCustom'),
|
|
('DoomTTS.ps1', '.'),
|
|
('LICENSE', '.'),
|
|
('README.md', '.'),
|
|
],
|
|
hiddenimports=[],
|
|
hookspath=[],
|
|
hooksconfig={},
|
|
runtime_hooks=[],
|
|
excludes=[],
|
|
noarchive=False,
|
|
optimize=0,
|
|
)
|
|
pyz = PYZ(a.pure)
|
|
|
|
exe = EXE(
|
|
pyz,
|
|
a.scripts,
|
|
[],
|
|
exclude_binaries=True,
|
|
name='Toby Doom Launcher',
|
|
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,
|
|
)
|
|
coll = COLLECT(
|
|
exe,
|
|
a.binaries,
|
|
a.datas,
|
|
strip=False,
|
|
upx=True,
|
|
upx_exclude=[],
|
|
name='Toby Doom Launcher',
|
|
)
|
|
|
|
# Post-build hook: Copy nvdaControllerClient.dll to _internal and copy/rename docs
|
|
build_dir = Path('build') / 'Toby Doom Launcher'
|
|
internal_dir = build_dir / '_internal'
|
|
|
|
# Copy NVDA DLL to _internal
|
|
nvda_dll_source = Path('nvdaControllerClient.dll')
|
|
nvda_dll_dest = internal_dir / 'nvdaControllerClient.dll'
|
|
if nvda_dll_source.exists() and internal_dir.exists():
|
|
shutil.copy2(str(nvda_dll_source), str(nvda_dll_dest))
|
|
print('✓ Copied nvdaControllerClient.dll to build/Toby Doom Launcher/_internal/')
|
|
|
|
# Copy and rename LICENSE file
|
|
license_source = Path('LICENSE')
|
|
license_dest = build_dir / 'toby-doom-launcher_LICENSE.txt'
|
|
if license_source.exists() and build_dir.exists():
|
|
shutil.copy2(str(license_source), str(license_dest))
|
|
print('✓ Copied LICENSE to build/Toby Doom Launcher/toby-doom-launcher_LICENSE.txt')
|
|
|
|
# Copy and rename README file
|
|
readme_source = Path('README.md')
|
|
readme_dest = build_dir / 'toby-doom-launcher_README.md'
|
|
if readme_source.exists() and build_dir.exists():
|
|
shutil.copy2(str(readme_source), str(readme_dest))
|
|
print('✓ Copied README.md to build/Toby Doom Launcher/toby-doom-launcher_README.md')
|
|
|