From 3bf39ce382dc7561054c456a64f5976d432fa9c9 Mon Sep 17 00:00:00 2001 From: avivm Date: Tue, 4 Jul 2023 18:28:08 +0300 Subject: [PATCH] fix: app updater quit and install not working (#659) * fix: app updater quit and install not working https://github.com/electron-userland/electron-builder/issues/1604 * docs(changeset): Fixed app updater quit and install --- .changeset/poor-humans-film.md | 5 +++++ app/src/infra/autoupdate/appUpdater.ts | 9 ++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 .changeset/poor-humans-film.md diff --git a/.changeset/poor-humans-film.md b/.changeset/poor-humans-film.md new file mode 100644 index 00000000..36e0d756 --- /dev/null +++ b/.changeset/poor-humans-film.md @@ -0,0 +1,5 @@ +--- +"@krud-dev/ostara-main": patch +--- + +Fixed app updater quit and install diff --git a/app/src/infra/autoupdate/appUpdater.ts b/app/src/infra/autoupdate/appUpdater.ts index 833561c2..9cf563b9 100644 --- a/app/src/infra/autoupdate/appUpdater.ts +++ b/app/src/infra/autoupdate/appUpdater.ts @@ -75,7 +75,14 @@ export class AppUpdater { } quitAndInstall() { - autoUpdater.quitAndInstall(); + setImmediate(() => { + app.removeAllListeners('window-all-closed'); + BrowserWindow.getAllWindows().forEach((window) => { + window.removeAllListeners('close'); + window.close(); + }); + autoUpdater.quitAndInstall(false); + }); } private async checkForUpdatesJob(runAnyways = false) {