-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathKeyAxis.spec
More file actions
71 lines (60 loc) · 1.83 KB
/
Copy pathKeyAxis.spec
File metadata and controls
71 lines (60 loc) · 1.83 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 KeyAxis.
Build: pyinstaller --noconfirm --clean KeyAxis.spec
Output: dist\\KeyAxis\\KeyAxis.exe (one-FOLDER build)
One-folder rather than one-file on purpose:
* starts noticeably faster (no unpack-to-temp on every launch),
* far fewer antivirus false positives,
* and the Inno Setup installer packs the folder anyway, so the user never
sees it.
User data (calibration.json / settings.json) is NOT written here - app.py puts
it in %LOCALAPPDATA%\\KeyAxis once frozen, so an install into Program Files
still works without admin rights and survives upgrades.
"""
from PyInstaller.utils.hooks import collect_all, collect_submodules
datas, binaries, hiddenimports = [], [], []
# vgamepad ships the ViGEm client DLLs; hid ships hidapi.dll. Missing-DLL errors
# at runtime are nearly always one of these two - collect_all is the blunt fix.
for pkg in ("vgamepad", "hid"):
d, b, h = collect_all(pkg)
datas += d
binaries += b
hiddenimports += h
# Pull in the right pywebview platform backend (edgechromium/WebView2 on Windows).
hiddenimports += collect_submodules("webview")
# Read-only resources loaded through resource_path().
datas += [("ui.html", ".")]
a = Analysis(
["app.py"],
pathex=[],
binaries=binaries,
datas=datas,
hiddenimports=hiddenimports,
hookspath=[],
runtime_hooks=[],
excludes=["tkinter", "matplotlib", "numpy", "PIL"],
noarchive=False,
)
pyz = PYZ(a.pure)
exe = EXE(
pyz,
a.scripts,
[],
exclude_binaries=True,
name="KeyAxis",
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=False,
console=False, # windowed - no black terminal
icon="keyaxis.ico",
)
coll = COLLECT(
exe,
a.binaries,
a.datas,
strip=False,
upx=False,
name="KeyAxis",
)