fix(update): re-evaluate policy on every update transition and skip NSIS updater on portable installs
This commit is contained in:
parent
a4acb42573
commit
88f3dbcd69
11 changed files with 1216 additions and 307 deletions
|
|
@ -150,6 +150,28 @@ runNodeScript('scripts/ci/verify-native-abi.mjs', ['--dir', appDir])
|
|||
// 이 파일이 없으면 electron-updater가 설정을 읽지 못해 자동 업데이트가 죽는다(실측).
|
||||
runNodeScript('scripts/ci/write-app-update-yml.mjs', ['--dir', appDir])
|
||||
|
||||
// 휴대용 표식: 이 트리(Scoop 7z · 수동 설치 zip)는 NSIS 설치자가 소유하지 않는다.
|
||||
// 런타임(src/main/install-kind.ts)은 NSIS 제거 프로그램이 없는 설치본에서 내장 자동 업데이트(NsisUpdater)를
|
||||
// 끈다 — 켜 두면 NSIS 설치자가 다른 경로에 두 번째 사본을 깔고, 실행 중인 사본은 옛 버전으로 남는다.
|
||||
// 표식은 그 판단을 명시하고 로그 사유를 남긴다. 파일 이름은 install-kind.ts 가 정본이다.
|
||||
const installKindSource = readFileSync(join(desktopDir, 'src', 'main', 'install-kind.ts'), 'utf8')
|
||||
const markerMatch = installKindSource.match(/export const PORTABLE_INSTALL_MARKER\s*=\s*'([^']+)'/)
|
||||
if (!markerMatch) {
|
||||
console.error('[portable] install-kind.ts에서 PORTABLE_INSTALL_MARKER를 찾을 수 없습니다.')
|
||||
process.exit(1)
|
||||
}
|
||||
const portableMarkerPath = join(appDir, 'resources', markerMatch[1])
|
||||
writeFileSync(
|
||||
portableMarkerPath,
|
||||
`${JSON.stringify({ kind: 'portable', version, updater: 'scoop-or-install-script' }, null, 2)}\n`,
|
||||
'utf8',
|
||||
)
|
||||
// 같은 win-unpacked 트리로 나중에 NSIS 설치자(--prepackaged)를 만들 수 있으므로, 아카이브를 만든 뒤에는
|
||||
// 표식을 지운다. (런타임은 NSIS 제거 프로그램을 먼저 보므로 표식이 섞여도 설치본 업데이트는 꺼지지 않는다.)
|
||||
process.on('exit', () => {
|
||||
rmSync(portableMarkerPath, { force: true })
|
||||
})
|
||||
|
||||
// 이전 볼륨 정리 (같은 버전 재드 시 잔여 볼륨이 섞이지 않도록)
|
||||
for (const name of readdirSync(releaseDir)) {
|
||||
if (name.startsWith(ARCHIVE_BASE)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue