fix(desktop): auto-update install now actually replaces the app

This commit is contained in:
zhayujie
2026-07-07 17:23:10 +08:00
parent 93bf8844de
commit 2e74295807
5 changed files with 62 additions and 18 deletions

View File

@@ -253,7 +253,14 @@ function setupIPC() {
setUpdateLanguage(lang)
startDownload()
})
ipcMain.handle('update-install', () => quitAndInstall())
ipcMain.handle('update-install', () => {
// Let the window actually close so the app can fully quit — otherwise the
// close-to-tray handler preventDefault()s it, the process stays alive, and
// Squirrel.Mac can't swap the app bundle (the update silently no-ops and
// relaunching still shows the old version).
isQuitting = true
quitAndInstall()
})
// Synchronous OS locale lookup (e.g. "zh-CN", "en-US"). Used by the renderer
// to pick a sensible default UI language on first run before any paint.