-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Why would a small minority of users get prompted by macOS for an admin password on quitAndInstall and then not receive the update? #6120
Comments
I suspect due to using of proxy — due to limitation of Squirrel.Mac, electron-updater have to start a temporary proxy server.
|
To understand what's going on, additional debug logging was added (#6122, not yet released), But current logging maybe also enough to better understand the reason of the issue.
|
Hey @develar, thank for you so much for the quick response. I'm 99% sure I figured this out, and I'm 99% sure it's user error. 🤦♂️ tl;dr Don't call Lets say there are 2 different users on a Mac:
If an app was installed by the admin user ( (Side note: It's helpful to turn on Fast User Switching and to use Minio as a fake S3 host to reproduce admin vs. non-admin auto-updater situations.) Here's where it went wrong in our case: We've had previous difficult-to-decipher issue where the auto-update process failed to quit/restart the app reliably, so one of us changed this code: // ... in response to `update-downloaded`
setTimeout(() => {
log.info(`quitting and installing now`);
autoUpdater.quitAndInstall();
}, 4000); to this setTimeout(() => {
log.info(`quitting and installing now`);
autoUpdater.quitAndInstall();
app.exit();
}, 4000); In an effort to ensure the app actually got quit. The addition of
This resulted in a loop where these users could never successfully auto-update. The users reported this behavior as as "the app crashing" because every 4 hours we check for updates and this sequence would be triggered. The fix was to switch to the official (?) @develar restart code from this comment. // long history of this not working well
// https://github.com/electron-userland/electron-builder/issues/3271
// https://github.com/electron-userland/electron-builder/issues/3269
// do it just like develar says: https://github.com/electron-userland/electron-builder/issues/1604#issuecomment-306709572
log.info(`quitting and installing now`);
setImmediate(() => {
app.removeAllListeners('window-all-closed');
const browserWindows = BrowserWindow.getAllWindows();
log.info(`closing ${browserWindows.length} BrowserWindows for autoUpdater.quitAndInstall`);
for (const browserWindow of browserWindows) {
browserWindow.close();
}
autoUpdater.quitAndInstall(false);
}); The key change is really just that we're not calling 💡 My recommendation is that the electron-updater README should have a few implementations to show how people can author a safe handler for the We're going to ship a new version of our app with this change. I'll report back if this fixes it. Thanks again for all the work you do on this project. It's well worth our donation and we really love this library. 🙏 🙏 🙏 |
@aguynamedben please let us know how that goes! |
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward? This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
I have 2 users that work at the same company that report a similar issue during auto-updates. The end result is these 2 users are in a loop that never lets them receive the auto-update. Every time we release a new version of our app, they have to manually install it by re-downloading our app from our website.
autoUpdater.quitAndInstall()
, in response toupdated-downloaded
, both users report a macOS admin password popup appears in order to request permission for the update.What would cause macOS to ask for a password during quitAndInstall? These users work at the same company so I'm wondering if they have any locked-down corporate permissions. Or is it something with the ShipIt directory file permissions?
Any ideas are welcome. 97% of our users get auto-updated correctly, so I know things generally work with notarization, signing, etc. but it seems like there is something with these users' environment that is producing a bad user experienced with auto-updating.
If asked them to
ls -alh
a bunch of directories to see permissions and paste their ShipIt stderr logs, I'll report back when I get those.$200 donation incoming! Thank you for all the open-source work you do. 🙏 🙏 🙏
The text was updated successfully, but these errors were encountered: