From 54040d2669d1b97644c5907bfcc05b02302bd95d Mon Sep 17 00:00:00 2001 From: Storm Dragon Date: Mon, 3 Nov 2025 20:55:15 -0500 Subject: [PATCH] Hopefully improve the .spec file to copy files in place and not open a console window. --- Toby Doom Launcher.spec | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/Toby Doom Launcher.spec b/Toby Doom Launcher.spec index e1d5bcb..07159e1 100644 --- a/Toby Doom Launcher.spec +++ b/Toby Doom Launcher.spec @@ -1,11 +1,18 @@ # -*- mode: python ; coding: utf-8 -*- +import shutil +from pathlib import Path a = Analysis( ['Toby Doom Launcher.py'], pathex=[], binaries=[], - datas=[], + datas=[ + ('TobyCustom', 'TobyCustom'), + ('DoomTTS.ps1', '.'), + ('LICENSE', '.'), + ('README.md', '.'), + ], hiddenimports=[], hookspath=[], hooksconfig={}, @@ -26,7 +33,7 @@ exe = EXE( bootloader_ignore_signals=False, strip=False, upx=True, - console=True, + console=False, disable_windowed_traceback=False, argv_emulation=False, target_arch=None, @@ -42,3 +49,29 @@ coll = COLLECT( 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') +