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
60
61
# -*- mode: python ; coding: utf-8 -*-
# PyInstaller spec — equivalent to:
# pyinstaller RailwayScannerPC.spec
# (one-file, windowed; entry app.py is the web-UI launcher/backend,
# ui.html is served by it; app icon from assets/icon.ico, icon files
# bundled as datas)
#
# The UI opens in an embedded pywebview window (WebView2). pywebview
# loads its platform backend dynamically at runtime, so the Windows
# backends are listed as hidden imports below; app.py imports webview
# lazily and falls back to a browser window when it is unavailable,
# so a build without pywebview still runs. The build environment
# must have pywebview installed next to PyInstaller for the embedded
# window to be present in the exe.
#
# Startup-speed notes: UPX is OFF (packing slows first-run extraction
# and trips Defender heuristics on an unsigned exe) and tkinter is
# excluded — the web UI replaced the Tkinter GUI, whose source
# (app_tk_legacy.py, reference only) must never be bundled.
a = Analysis(
["app.py"],
pathex=[],
binaries=[],
datas=[("ui.html", "."), ("assets/icon.png", "assets"), ("assets/icon.ico", "assets")],
hiddenimports=[
"webview",
"webview.platforms.edgechromium",
"webview.platforms.winforms",
"webview.platforms.mshtml",
],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=["tkinter", "_tkinter", "Tkinter", "app_tk_legacy"],
noarchive=False,
)
pyz = PYZ(a.pure)
exe = EXE(
pyz,
a.scripts,
a.binaries,
a.datas,
[],
name="RailwayScannerPC",
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=False,
upx_exclude=[],
runtime_tmpdir=None,
console=False,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
icon="assets/icon.ico",
)