KINDNICK b91b229731 v2.2.3: stage updater.exe outside dist/ to survive main.spec --clean
main.spec's --clean flag wipes dist/ at the start of main.exe build,
which deleted dist/updater.exe before it could be embedded as data
(v2.2.2 main.exe shipped without embedded updater).

Fix: release.ps1 copies dist/updater.exe to build/staging/ after
the updater build, and main.spec datas references that staged path.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 16:15:51 +09:00

57 lines
1.5 KiB
Python

# -*- mode: python ; coding: utf-8 -*-
# Build order: updater.spec FIRST, then main.spec.
# main.exe embeds dist/updater.exe so users can deploy main.exe alone;
# the embedded updater is auto-extracted next to main.exe on first launch.
import os
# release.ps1 stages updater.exe at build/staging/updater.exe
# (avoids PyInstaller --clean wiping dist/updater.exe before main build).
_extra_datas = []
_staged = 'build/staging/updater.exe'
_fallback = 'dist/updater.exe'
if os.path.exists(_staged):
_extra_datas.append((_staged, '.'))
elif os.path.exists(_fallback):
_extra_datas.append((_fallback, '.'))
a = Analysis(
['main.py'],
pathex=[],
binaries=[],
datas=[('3d-alarm.png', '.')] + _extra_datas,
hiddenimports=[
'holidays', 'holidays.countries.south_korea',
'win32evtlog', 'win32evtlogutil',
'matplotlib.backends.backend_qt5agg',
],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=['pandas', 'numpy.testing', 'PyQt5.QtWebEngineWidgets'],
noarchive=False,
optimize=0,
)
pyz = PYZ(a.pure)
exe = EXE(
pyz,
a.scripts,
a.binaries,
a.datas,
[],
name='main',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=False,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
icon=['3d-alarm.ico'],
)