File size: 1,147 Bytes
d5174e7 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
import PyInstaller.__main__
import shutil
import os
# Aufräumen vorheriger Builds
for folder in ['build', 'dist', '__pycache__']:
if os.path.exists(folder):
shutil.rmtree(folder)
# PyInstaller Optionen ohne --icon
opts = [
'main.py',
'--name=SmartTaskTool_by_Sevenof9',
'--onefile',
#'--console',
'--noconsole',
'--windowed',
'--clean',
'--log-level=WARN',
'--add-data=gui.py;.', # gui.py in dist/ kopieren
'--add-data=tray.py;.', # tray.py in dist/ kopieren
'--add-data=hardware.py;.', # hardware.py in dist/ kopieren
'--add-data=restart_helper.py;.', # restart_helper.py in dist/ kopieren
'--add-data=DePixelSchmal.otf;.',
]
# Hidden-Imports
hidden_imports = [
'win32com',
'win32com.client',
'pythoncom',
'pystray._win32',
'pystray._base',
'wmi',
'pynvml',
'pystray',
'PIL.Image',
'PIL.ImageDraw',
'PIL.ImageFont',
'pythoncom',
'wx',
'difflib',
'psutil'
]
for hidden in hidden_imports:
opts.append(f'--hidden-import={hidden}')
PyInstaller.__main__.run(opts)
|