|
import PyInstaller.__main__
|
|
import shutil
|
|
import os
|
|
|
|
|
|
for folder in ['build', 'dist', '__pycache__']:
|
|
if os.path.exists(folder):
|
|
shutil.rmtree(folder)
|
|
|
|
|
|
opts = [
|
|
'main.py',
|
|
'--name=SmartTaskTool_by_Sevenof9',
|
|
'--onefile',
|
|
|
|
'--noconsole',
|
|
'--windowed',
|
|
'--clean',
|
|
'--log-level=WARN',
|
|
'--add-data=gui.py;.',
|
|
'--add-data=tray.py;.',
|
|
'--add-data=hardware.py;.',
|
|
'--add-data=restart_helper.py;.',
|
|
'--add-data=DePixelSchmal.otf;.',
|
|
]
|
|
|
|
|
|
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)
|
|
|