electron-builder: The command is disabled and cannot be executed at MacUpdater.quitAndInstall
- Electron Version:^12.0.2
- Electron-builder:^22.10.5
- Electron-updater:^4.3.8
-
Target: Mac
-
NPM Version: 6.14.11
-
Node Version: v14.16.0
windows auto update work perfectly, but on Mac, when the application has finished updating, this error appears twice

and once I hit ok, the app reopen itself and complete the update. How can I get rid of this macUpdater issue? I am new to electron and any help would be appreciated, Thanks.
code:
autoUpdater.on('update-downloaded', () => {
const options = {
buttons: [],
title: i18n.translate('updateRelaunchRequired'),
message: i18n.translate('updateWillRestart'),
};
dialog.showMessageBox(options).then(
(result) => {
setImmediate(() => autoUpdater.quitAndInstall(false, true));
},
(error) => {
main.log(`autoUpdater.on showMessageBox error`, error);
}
);
});
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 4
- Comments: 38
Commits related to this issue
- Downgrade electron-updater to 4.3.5. Newer electron-updater versions are broken on macOS by https://github.com/electron-userland/electron-builder/issues/5935 as well as another issue that has not yet... — committed to andersk/zulip-desktop by andersk 3 years ago
- Downgrade electron-updater to 4.3.5. Newer electron-updater versions are broken on macOS by https://github.com/electron-userland/electron-builder/issues/5935 as well as another issue that has not yet... — committed to andersk/zulip-desktop by andersk 3 years ago
I get the same error
electron-builder: 22.11.7electron-updater: 4.3.9This error occur 2 times.
UPDATE:
Okay, so the problem is actually in the quitAndInstall() method.
If I update the.
node_modules/electron-updater/out/MacUpdater.js:135to not include the extra check. The updater install the updates and restart the app with the new version.@mmaietta I’ve started seeing this issue recently, and it’s sporadic. Some more details in case it helps debug:
Versions of packages:
The code that triggers the auto-update quit and install:
The observed error from user perspective is that the “Update: A new version is available” dialog appears multiple times and clicking on it more than once causes the application to crash. The update ends up being installed successfully, but it’s not a great user experience. The error is also not consistent - only some users have reported this, though the frequency went up recently
The observed error from stack trace:
Debugging is tricky because the error is sporadic and cannot be reproduced locally 100% of the time. If I ship a fix that causes the updates to stop getting installed, then some users get kicked out of the update flow permanently. Trying to work on a 100% local repro, but no luck so far.