Repository navigation
Expand file tree
/
Copy pathsharknet.spec
More file actions
71 lines (64 loc) · 2.16 KB
/
Copy pathsharknet.spec
File metadata and controls
71 lines (64 loc) · 2.16 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
60
61
62
63
64
65
66
67
68
69
70
71
# -*- mode: python ; coding: utf-8 -*-
# PyInstaller spec for SharkNet -> builds dist/SharkNet/SharkNet.exe
from PyInstaller.utils.hooks import collect_all, collect_submodules
datas = [("frontend", "frontend"), ("assets", "assets"),
("backend/data", "backend/data")] # SHARKmac vendor OUI database
binaries = []
hiddenimports = ["backend", "backend.server", "backend.engine.services_update",
# V3.1 background runtime (imported lazily at startup)
"backend.tray", "backend.localization", "backend.single_instance"]
# V3.1 tray: pystray picks its Windows backend at import time, so the win32
# backend + the Pillow codecs that read assets/sharknet.ico must be named
# explicitly or the frozen build silently falls back to "no tray".
# NOTE: deliberately NOT PIL._tkinter_finder — tkinter is excluded below.
hiddenimports += ["pystray", "pystray._win32", "PIL", "PIL.Image",
"PIL.IcoImagePlugin", "PIL.PngImagePlugin", "PIL.BmpImagePlugin"]
# bundle libraries that need their data/native files collected
for pkg in ("webview", "clr_loader", "pythonnet", "pystray", "PIL"):
try:
d, b, h = collect_all(pkg)
datas += d
binaries += b
hiddenimports += h
except Exception:
pass
hiddenimports += collect_submodules("uvicorn")
hiddenimports += ["websockets", "watchfiles"]
a = Analysis(
["run.py"],
pathex=[],
binaries=binaries,
datas=datas,
hiddenimports=hiddenimports,
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=["tkinter", "matplotlib"],
noarchive=False,
)
pyz = PYZ(a.pure)
exe = EXE(
pyz,
a.scripts,
[],
exclude_binaries=True,
name="SharkNet",
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=False,
console=False, # no black terminal window
disable_windowed_traceback=False,
uac_admin=True, # request Administrator on launch
icon="assets/sharknet.ico",
version="version_info.txt", # Windows FileVersion/ProductVersion = 3.2.0
)
coll = COLLECT(
exe,
a.binaries,
a.datas,
strip=False,
upx=False,
upx_exclude=[],
name="SharkNet",
)