Skip to content

Commit

Permalink
Emit 'before-quit-for-update' when updating via novel means (#6395)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nokel81 committed Nov 12, 2021
1 parent a3dd05f commit 3c38af4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions .changeset/sixty-queens-tell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"electron-updater": patch
---

Emulate electron.autoUpdater's event lifecycle for AppImageUpdater
2 changes: 2 additions & 0 deletions packages/electron-updater/src/BaseUpdater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ export abstract class BaseUpdater extends AppUpdater {
const isInstalled = this.install(isSilent, isSilent ? isForceRunAfter : true)
if (isInstalled) {
setImmediate(() => {
// this event is normally emitted when calling quitAndInstall, this emulates that
require("electron").autoUpdater.emit("before-quit-for-update")
this.app.quit()
})
} else {
Expand Down

0 comments on commit 3c38af4

Please sign in to comment.