From b91b229731a172ccdaa2124fd47b870d53406704 Mon Sep 17 00:00:00 2001 From: KINDNICK Date: Thu, 30 Apr 2026 16:15:51 +0900 Subject: [PATCH] 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) --- CHANGELOG.md | 9 +++++++++ core/version.py | 2 +- main.spec | 10 ++++++++-- release.ps1 | 12 ++++++++++++ 4 files changed, 30 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 99c217e..540adfa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,15 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). +## [2.2.3] — 2026-04-30 + +### Fixed +- **`updater.exe` 임베딩 빌드 안정화** + - v2.2.2에서 `main.spec --clean`이 빌드 시작 시 `dist/updater.exe`를 지우면서 + 임베딩이 누락되던 문제 수정 + - `release.ps1`이 `dist/updater.exe`를 `build/staging/`로 복사 후 main.spec이 그걸 참조 + - main.exe 사이즈가 다시 ~78MB (updater 내장) 로 정상화 + ## [2.2.2] — 2026-04-30 ### Added diff --git a/core/version.py b/core/version.py index 691ba0e..99ea382 100644 --- a/core/version.py +++ b/core/version.py @@ -4,4 +4,4 @@ 릴리스 시 이 값을 올린 후 git tag → push. CHANGELOG.md의 최상단 항목과 일치시킬 것. """ -__version__ = '2.2.2' +__version__ = '2.2.3' diff --git a/main.spec b/main.spec index 299adb2..056291a 100644 --- a/main.spec +++ b/main.spec @@ -4,9 +4,15 @@ # 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 = [] -if os.path.exists('dist/updater.exe'): - _extra_datas.append(('dist/updater.exe', '.')) +_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'], diff --git a/release.ps1 b/release.ps1 index d5a56f3..ad28fef 100644 --- a/release.ps1 +++ b/release.ps1 @@ -120,11 +120,23 @@ $rc = Invoke-Native python -m PyInstaller --clean updater.spec if ($rc -ne 0) { Fail "updater.exe build failed (exit $rc)" } if (-not (Test-Path 'dist/updater.exe')) { Fail "dist/updater.exe missing" } +# Stage updater.exe outside dist/ so main.spec --clean does not wipe it +$stagingDir = 'build/staging' +if (-not (Test-Path $stagingDir)) { New-Item -ItemType Directory -Path $stagingDir | Out-Null } +Copy-Item 'dist/updater.exe' "$stagingDir/updater.exe" -Force +Info "Staged updater.exe -> $stagingDir/updater.exe" + Info "Building main.exe (with embedded updater)..." $rc = Invoke-Native python -m PyInstaller --clean main.spec if ($rc -ne 0) { Fail "main.exe build failed (exit $rc)" } if (-not (Test-Path 'dist/main.exe')) { Fail "dist/main.exe missing" } +# Restore updater.exe to dist/ for separate Release asset upload +if (-not (Test-Path 'dist/updater.exe')) { + Copy-Item "$stagingDir/updater.exe" 'dist/updater.exe' -Force + Info "Restored updater.exe to dist/" +} + $mainSize = "{0:N1}MB" -f ((Get-Item dist/main.exe).Length / 1MB) $updaterSize = "{0:N1}MB" -f ((Get-Item dist/updater.exe).Length / 1MB) OkMsg "main.exe ($mainSize) + updater.exe ($updaterSize)"