electron-userland / electron-builder

A complete solution to package and build a ready for distribution Electron app with “auto update” support out of the box
https://www.electron.build
MIT License
13.47k stars 1.71k forks source link

[electron-updater] [Windows] [NSIS] Updater leaves app in unrecoverable state if update is performed during sign out or shut down #7807

Open popod opened 9 months ago

popod commented 9 months ago

This problem seem to exists from a while on Windows with NSIS update on app quit ! This works fine with macOS, only Windows does not works !

If the NSIS Windows updater is running during a shutdown or log-off, the app will become in an unrecoverable state (the executable will be removed from the AppData folder, etc.) ! This leads to the app being unusable !

It is common for users to quit an app (and trigger an update) before shutting down or logging off the computer so this seems like this could be quite a common issue. We had multiple reports of this from customers and I was able to reproduce it myself also.

This are similar issues : https://github.com/electron-userland/electron-builder/issues/3798, https://github.com/electron-userland/electron-builder/issues/7294, https://github.com/electron-userland/electron-builder/issues/3362, ...

We're experiencing a proper error condition when using auto-updater: Our application is run by our customers from boot to shutdown (I'd even say "from dawn to dusk" :p). This means that the auto-updater finds an update and marks it for installation on exit - fine.

Now, the user's work day ends, they want to run home. They shut down the app (the update installer starts), and immediately shut down windows.

Now, windows at some point kills the update installer NSIS process, leaving behind an incompletely installed app! 💥

So, is there any mechanism to make the NSIS auto update works on windows when the update is trigged on application quit ?

To resolve this, a workaround is to set autoInstallOnAppQuit=false. But in this case, the application can only be updated with autoUpdater.quitAndInstall() which is not really user friendly and does not resolve the problem..

I think that possibles solutions are:

Thanks your for reply and for providing a real solution for this big issue !

github-actions[bot] commented 7 months ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

popod commented 7 months ago

Not stale.. Any reply or solution would be welcome :)

github-actions[bot] commented 2 months ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

popod commented 2 months ago

Still not stale..

github-actions[bot] commented 2 weeks ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.

ivanggq commented 6 days ago

Also having this issue occasionally.