mirror of
https://github.com/zhayujie/chatgpt-on-wechat.git
synced 2026-07-17 11:07:11 +08:00
fix(desktop): restore install-dir choice on Windows first install
This commit is contained in:
@@ -103,8 +103,9 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"nsis": {
|
"nsis": {
|
||||||
"oneClick": true,
|
"oneClick": false,
|
||||||
"perMachine": false,
|
"perMachine": false,
|
||||||
|
"allowToChangeInstallationDirectory": true,
|
||||||
"createDesktopShortcut": true,
|
"createDesktopShortcut": true,
|
||||||
"createStartMenuShortcut": true
|
"createStartMenuShortcut": true
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -233,15 +233,13 @@ 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=FALSE on Windows. Our installer is oneClick (package.json
|
// isSilent=TRUE on Windows. Our installer is now ASSISTED (nsis.oneClick=false
|
||||||
// nsis.oneClick=true), so a non-silent install is still wizard-less/quick —
|
// + allowToChangeInstallationDirectory) so the FIRST install shows the
|
||||||
// but crucially, with isSilent=true the isForceRunAfter flag is unreliable and
|
// directory/mode wizard. But an UPDATE must NOT re-show that wizard — isSilent
|
||||||
// the app often installs yet never relaunches (electron-builder #1746: exactly
|
// skips it and updates in place. isForceRunAfter=true relaunches after the
|
||||||
// the "update succeeds but app doesn't reopen" symptom we hit on 0.9.7->0.9.8).
|
// silent update. (The old assisted+silent force-run bug, #2179, was fixed
|
||||||
// With isSilent=false, isForceRunAfter is ignored and relaunch is instead
|
// upstream in PR #2278; we're on electron-updater 6.8.9, well past it.)
|
||||||
// governed by autoRunAppAfterInstall (default true), which reliably reopens the
|
// setImmediate + removeAllListeners are the documented prerequisites for the
|
||||||
// app after a oneClick install. macOS ignores isSilent entirely.
|
// relaunch to fire reliably. macOS ignores isSilent entirely.
|
||||||
// setImmediate lets the current IPC callstack unwind and the app fully settle
|
setImmediate(() => autoUpdater.quitAndInstall(true, true))
|
||||||
// into quit before the installer takes over — without it relaunch is flaky.
|
|
||||||
setImmediate(() => autoUpdater.quitAndInstall(false, true))
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user