mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-07-17 11:07:11 +08:00
fix(desktop): Windows auto-update installs but doesn't relaunch
This commit is contained in:
@@ -233,15 +233,15 @@ export function quitAndInstall(): void {
|
|||||||
// process alive and stop the installer from replacing files / relaunching
|
// process alive and stop the installer from replacing files / relaunching
|
||||||
// (a documented electron-updater gotcha, esp. on Windows NSIS).
|
// (a documented electron-updater gotcha, esp. on Windows NSIS).
|
||||||
app.removeAllListeners('window-all-closed')
|
app.removeAllListeners('window-all-closed')
|
||||||
// isSilent=true, isForceRunAfter=true: our Windows installer is now a oneClick
|
// isSilent=FALSE on Windows. Our installer is oneClick (package.json
|
||||||
// NSIS installer (package.json nsis.oneClick=true), which is the combination
|
// nsis.oneClick=true), so a non-silent install is still wizard-less/quick —
|
||||||
// electron-updater actually supports for silent auto-update + auto-relaunch.
|
// but crucially, with isSilent=true the isForceRunAfter flag is unreliable and
|
||||||
// The previous assisted installer (oneClick:false) with silent install is a
|
// the app often installs yet never relaunches (electron-builder #1746: exactly
|
||||||
// long-standing broken combo: it would delete the old install but not fully
|
// the "update succeeds but app doesn't reopen" symptom we hit on 0.9.7->0.9.8).
|
||||||
// reinstall / not relaunch, leaving a black screen on next launch
|
// With isSilent=false, isForceRunAfter is ignored and relaunch is instead
|
||||||
// (electron-builder issues #2179 / #1746). macOS ignores isSilent.
|
// governed by autoRunAppAfterInstall (default true), which reliably reopens the
|
||||||
|
// app after a oneClick install. macOS ignores isSilent entirely.
|
||||||
// setImmediate lets the current IPC callstack unwind and the app fully settle
|
// setImmediate lets the current IPC callstack unwind and the app fully settle
|
||||||
// into quit before the installer takes over — without it the relaunch is
|
// into quit before the installer takes over — without it relaunch is flaky.
|
||||||
// flaky on Windows.
|
setImmediate(() => autoUpdater.quitAndInstall(false, true))
|
||||||
setImmediate(() => autoUpdater.quitAndInstall(true, true))
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user