Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: quitAndInstall not working on macOS with autoInstallOnAppQuit=false #6390

Merged
merged 3 commits into from
Nov 9, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/olive-weeks-look.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"electron-updater": patch
---

Fix updating only on demand not working on macOS
10 changes: 9 additions & 1 deletion packages/electron-updater/src/MacUpdater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,18 @@ export class MacUpdater extends AppUpdater {
// update already fetched by Squirrel, it's ready to install
this.nativeUpdater.quitAndInstall()
} else {
// quit and install as soon as Squirrel get the update
// Quit and install as soon as Squirrel get the update
this.nativeUpdater.on("update-downloaded", () => {
this.nativeUpdater.quitAndInstall()
})

if (!this.autoInstallOnAppQuit) {
/**
* If this was not `true` previously then MacUpdater.doDownloadUpdate()
* would not actually initiate the downloading by electron's autoUpdater
*/
this.nativeUpdater.checkForUpdates()
}
}
}
}