Skip to content

Commit

Permalink
fix: Updater "Error: Could not connect to the server." in macOS (#6743)
Browse files Browse the repository at this point in the history
* Don't close server directly at quitAndInstall
  • Loading branch information
YanDevDe committed Apr 7, 2022
1 parent 370f84b commit 27f18aa
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/metal-elephants-remain.md
@@ -0,0 +1,5 @@
---
"electron-updater": patch
---

fix: Updater "Error: Could not connect to the server." in macOS. Don't close server directly at quitAndInstall #6743
3 changes: 2 additions & 1 deletion packages/electron-updater/src/MacUpdater.ts
Expand Up @@ -213,14 +213,15 @@ export class MacUpdater extends AppUpdater {
}

quitAndInstall(): void {
this.server?.close()
if (this.squirrelDownloadedUpdate) {
// update already fetched by Squirrel, it's ready to install
this.nativeUpdater.quitAndInstall()
this.server?.close()
} else {
// Quit and install as soon as Squirrel get the update
this.nativeUpdater.on("update-downloaded", () => {
this.nativeUpdater.quitAndInstall()
this.server?.close()
})

if (!this.autoInstallOnAppQuit) {
Expand Down

0 comments on commit 27f18aa

Please sign in to comment.