Repository navigation
Restart after an update without app.relaunch() - #15
Merged
Merged
Conversation
After "Update and restart", electron-updater starts the app again with app.relaunch(), and Chromium launches that process with no_new_privs. The flag is inherited by every child and makes setuid pkexec fail at once, so the next update failed with "administrator authentication was cancelled or failed" until the user quit and started the app by hand. For deb and rpm, turn off electron-updater's relaunch and start the app ourselves: a detached waiter (the app binary with ELECTRON_RUN_AS_NODE, no shell) waits for the old process to exit, since it holds the single-instance lock, then starts the app with the same arguments. A process that already has no_new_privs does not try pkexec and says to restart the app instead. AppImage keeps electron-updater's own start.
redacid
pushed a commit
that referenced
this pull request
Dec 3, 2026
Version bump and changelog for restarting after an update without app.relaunch() (#15).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The second in-app update in a row failed with "administrator authentication was cancelled or failed"; after starting the app by hand it worked.
Cause. electron-updater restarts the app with
app.relaunch(), and Chromium launches that process withno_new_privs. Every child inherits it, so setuidpkexeccannot gain root and exits before showing a password dialog. Seen on the installed app: the relaunched process hadNoNewPrivs: 1(parent pid 1), and polkit logged nothing for the failed attempt, while the earlier install logged authentication anddpkg -i.Fix
autoRunAppAfterInstall = falseandquitAndInstall(false, false); after a successful install,relaunch.tsstarts a detached waiter (the app binary withELECTRON_RUN_AS_NODE, no shell) that waits for the old process to exit (single-instance lock), then starts the app with the same arguments, withoutno_new_privs.no_new_privsdoes not trypkexec; it tells the user to quit from the tray and start the app again (needed once for processes relaunched by 0.2.11 and older).Tested
make check: 203 tests (relaunch only after success, NNP refusal without pkexec, waiter starts the command after the old process exits with its arguments and withoutELECTRON_RUN_AS_NODE).ELECTRON_RUN_AS_NODEworks with the installed binary.Docs:
docs/install.md,docs-dev/architecture.md(App updater).