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...@@ -810,7 +810,11 @@ async function installDownloadedUpdate(): Promise<{ accepted: boolean; completed
810 clearUpdatePollTimer();810 clearUpdatePollTimer();
811 try {811 try {
812 await stopBackendAndWaitForExit();812 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);
814 return { accepted: true, completed: true };818 return { accepted: true, completed: true };
815 } catch (error: unknown) {819 } catch (error: unknown) {
816 const message = formatErrorMessage(error);820 const message = formatErrorMessage(error);
...@@ -1390,7 +1394,7 @@ app...@@ -1390,7 +1394,7 @@ app
1390 });1394 });
13911395
1392app.on("window-all-closed", () => {1396app.on("window-all-closed", () => {
1393 if (process.platform !== "darwin") {1397 if (process.platform !== "darwin" && !isQuitting) {
1394 app.quit();1398 app.quit();
1395 }1399 }
1396});1400});