authorgravatar for 73656233+danielss-dev@users.noreply.github.comDaniels <73656233+danielss-dev@users.noreply.github.com> 2026-03-28 19:51:44+01:00
committergravatar for noreply@github.comGitHub <noreply@github.com> 2026-03-28 11:51:44-07:00
log52fa6a733342a2e5c5d421e90c8f31755fb76395
tree22869475910feb1a3aeac33820eb1e71097d7413
parent04298962be548a2d80433d0cc2c777a8b9de12a2
signature Signed by PGP key B5690EEEBB952194

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

Co-authored-by: Daniel Schwarz <daniel.schwarz@serviceware-se.com>

1 files changed, 6 insertions(+), 2 deletions(-)

apps/desktop/src/main.ts+6-2
......@@ -810,7 +810,11 @@ async function installDownloadedUpdate(): Promise<{ accepted: boolean; completed
810810 clearUpdatePollTimer();
811811 try {
812812 await stopBackendAndWaitForExit();
813 autoUpdater.quitAndInstall();
813 // Destroy all windows before launching the NSIS installer to avoid the installer finding live windows it needs to close.
814 for (const win of BrowserWindow.getAllWindows()) {
815 win.destroy();
816 }
817 autoUpdater.quitAndInstall(true, true);
814818 return { accepted: true, completed: true };
815819 } catch (error: unknown) {
816820 const message = formatErrorMessage(error);
......@@ -1390,7 +1394,7 @@ app
13901394 });
13911395
13921396app.on("window-all-closed", () => {
1393 if (process.platform !== "darwin") {
1397 if (process.platform !== "darwin" && !isQuitting) {
13941398 app.quit();
13951399 }
13961400});