-
Notifications
You must be signed in to change notification settings - Fork 865
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
fix: windows auto-update #1679
fix: windows auto-update #1679
Conversation
…ll users (#1556)" This reverts commit c26525f. Context: #1570 (comment)
@jessicaschilling unclear. that error could be a side effect of autoupdate issue, or a duplicate of #1676 – asked for more information. |
Closing the shop for today, but quick update: I looked into setting up local update server, but it effectively becomes Rube Goldberg machine and I don't believe it is a reliable way of testing and debugging this. To be sure we test the right thing, we literally need to test in production. For that reason I created a test app with CI and electron config similar to Desktop. I'll copy relevant autoupdate code from Desktop tomorrow, so it is identical, and then we have setup to run some end-to-end tests. |
Tested with altschmerz v0.0.3 → v0.0.4) and the simplified autoupdate provided by The failure is the same as one described in #1514, so the original bug is still present in Next:
|
Disclaimer: I am not a Windows person, so this may be obvious stuff, but took me a while to understand all the moving pieces. Having the altschmerz test app helped a lot. I believe the crux of the problem was that we use custom NSIS settings, namely: nsis:
oneClick: false
warningsAsErrors: false
perMachine: false
allowToChangeInstallationDirectory: true
allowElevation: true # note: this is true by default, even when not defined in config By default we install per user ( We don't want to require admin all the time, because users should be able to install IPFS on machines where they don't have Admin (schools, libraries). That is why
if (options.perMachine === true) {
defines.INSTALL_MODE_PER_ALL_USERS = null
}
if (!oneClick || options.perMachine === true) {
defines.INSTALL_MODE_PER_ALL_USERS_REQUIRED = null
}
In our case, TLDR the fix here is to
I'll prepare (b) first, as (a) will take long time before the fix lands upstream, and I still don't trust there won't be any regressions, as we had so many in the past, unfortunately. |
This implements fix described in: #1679 (comment) License: MIT Signed-off-by: Marcin Rataj <lidel@lidel.org>
Tested in lidel/electron-updater-altschmerz#1 and ported the fix in 0bf120d – ok to merge and ship patch release? |
Tested and looks good, but we can only really find out on the next version... so 🚢 it ! |
autoInstallOnAppQuit works fine on windows, but we had a bunch of code responsible for doing it manually due to macOS not being supported natively by autoInstallOnAppQuit. Due to this fix from #1679 was not applied correctly, and macOS-specific handling broke updates on windows. This change ensures that macOS keeps using the old upgrade paths, but Windows and AppImage leverage upstream code for applying upgrades. License: MIT Signed-off-by: Marcin Rataj <lidel@lidel.org>
autoInstallOnAppQuit works fine on windows, but we had a bunch of code responsible for doing it manually due to macOS not being supported natively by autoInstallOnAppQuit. Due to this fix from #1679 was not applied correctly, and macOS-specific handling broke updates on windows. This change ensures that macOS keeps using the old upgrade paths, but Windows and AppImage leverage upstream code for applying upgrades. License: MIT Signed-off-by: Marcin Rataj <lidel@lidel.org>
Hi guys! I encountered this PR while resolving some of the UAC issues with electron-builder auto updater. Just wanted to let you know that there might be an alternative solution - modifying the access rights after the installation, to grant full access permissions to the non-admin users (to be honest not my idea, I just observed what Steam does) so no administrative rights are required for the updater. Here's the snippet for custom NSIS include:
Note that you need to link AccessControl plugin to NSIS either through Cheers and good luck with your project! |
@witcher112 thank you, useful to know there is an alternative approach in case current one stops working. Maybe I misunderstood the meaning of IIUC one user could overwrite binary that other users run. |
This PR aims to close #1570
Context: #1570 (comment)
WIP
electron-builder
fixed the original problem upstreamcc @jessicaschilling @rafaelramalho19