fix(desktop): ensure all windows are destroyed before launching the NSIS installer during update process (#1461)

Co-authored-by: Daniel Schwarz <[email protected]>
This commit is contained in:
DanielsandDaniel Schwarz authored and GitHub committed 2026-03-28 11:51:44 -07:00
1 parent 04298962be
commit 52fa6a7333
1 file changed
+6 -2
+6 -2
View File
@@ -810,7 +810,11 @@ async function installDownloadedUpdate(): Promise<{ accepted: boolean; completed
clearUpdatePollTimer();
try {
await stopBackendAndWaitForExit();
autoUpdater.quitAndInstall();
// Destroy all windows before launching the NSIS installer to avoid the installer finding live windows it needs to close.
for (const win of BrowserWindow.getAllWindows()) {
win.destroy();
}
autoUpdater.quitAndInstall(true, true);
return { accepted: true, completed: true };
} catch (error: unknown) {
const message = formatErrorMessage(error);
@@ -1390,7 +1394,7 @@ app
});
app.on("window-all-closed", () => {
if (process.platform !== "darwin") {
if (process.platform !== "darwin" && !isQuitting) {
app.quit();
}
});