From 52fa6a733342a2e5c5d421e90c8f31755fb76395 Mon Sep 17 00:00:00 2001 From: Daniels <73656233+danielss-dev@users.noreply.github.com> Date: Sat, 28 Mar 2026 19:51:44 +0100 Subject: [PATCH] fix(desktop): ensure all windows are destroyed before launching the NSIS installer during update process (#1461) Co-authored-by: Daniel Schwarz --- apps/desktop/src/main.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/apps/desktop/src/main.ts b/apps/desktop/src/main.ts index c718a3127204d0e30a9998b72be29902de926fec..9e2950462e856cee8a09dfe6afcf6bf85d19d700 100644 --- a/apps/desktop/src/main.ts +++ b/apps/desktop/src/main.ts @@ -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(); } }); -- 2.54.0