-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgui_main.spec
More file actions
59 lines (51 loc) · 1.25 KB
/
Copy pathgui_main.spec
File metadata and controls
59 lines (51 loc) · 1.25 KB
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
51
52
53
54
55
56
57
58
59
from PyInstaller.utils.hooks import collect_submodules
# Define the main script
main_script = 'SRC/gui/gui_main.py'
# Add the path to the `SRC` directory
pathex = ['.', 'SRC']
# Collect hidden imports (submodules in `core` and `gui`)
hidden_imports = collect_submodules('core') + collect_submodules('gui')
# Add data files to be included in the executable
datas = [
('SRC/core', 'core'),
('SRC/gui', 'gui'),
('SRC', 'SRC')
]
# Build the analysis
a = Analysis(
[main_script],
pathex=pathex,
binaries=[],
datas=datas, # Add data files manually if needed
hiddenimports=hidden_imports,
hookspath=[],
runtime_hooks=[],
excludes=[],
win_no_prefer_redirects=False,
win_private_assemblies=False,
cipher=None,
)
# Build the Python Zip archive
pyz = PYZ(a.pure, a.zipped_data, cipher=None)
# Create the executable
exe = EXE(
pyz,
a.scripts,
exclude_binaries=True,
name='swat_processor',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=False, # Change to False for a windowed app
)
# Collect all binaries and files for final packaging
coll = COLLECT(
exe,
a.binaries,
a.zipfiles,
a.datas,
strip=False,
upx=True,
name='swat_processor',
)