Repository navigation
Stop silent updates from waiting on the "Failed to uninstall" dialog - #142
Draft
IliaMManolov wants to merge 1 commit into
Draft
IliaMManolov wants to merge 1 commit into
IliaMManolov wants to merge 1 commit into
Conversation
electron-builder shows "Failed to uninstall old application files" with a MessageBox that has no /SD default, so the box also appears in a silent install. When the previous version's uninstaller fails during an auto-update, the update waits on that dialog and looks stuck. customUnInstallCheck(CurrentUser) now reproduce electron-builder's default handling with /SD IDOK added: a silent run fails at once with error level 2, and interactive installs still show the dialog. A test pins the upstream handleUninstallResult so an electron-builder upgrade that changes it fails. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WiFcRTVRzq2KVKYAgvKyNK
4 of 5 tasks
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.
Small installer fix, independent of the telemetry MVP in #141. For Ilia's review. Do not merge yet.
Summary
During an upgrade, the NSIS installer first runs the previous version's uninstaller. If that uninstaller fails, electron-builder shows "Failed to uninstall old application files. Please try running the installer again." This
MessageBoxhas no/SDdefault, so it also appears in a silent install. A silent auto-update therefore waits on a dialog that the user did not start, and the update looks stuck until someone clicks OK.build/installer.nshnow definescustomUnInstallCheckandcustomUnInstallCheckCurrentUser. They reproduce electron-builder's default handling (handleUninstallResultin app-builder-lib 26.x) and add only/SD IDOK:/SDapplies only to silent runs.src/main/__tests__/nsisUninstallCheck.test.tspins the upstream function. An electron-builder upgrade that changes it fails the test, so the copy gets reviewed.Overlap with #141
#141 defines the same two macros to add telemetry. The second of the two PRs to merge gets a small conflict in
installer.nsh. I will rebase #141 onto this fix when one of them merges.Test plan
npm run typecheck,npx vitest run: 211 tests pass, 1 new (pin test).-WX): unchangedmain, and this branch./S --updated) with the oldUninstall SealGate.exereplaced by a program that exits with code 1:main: the dialog appears and the installer waits until it is killed. The harness stopped it after 60 s (exit 124).Generated by Claude Code
Summary by cubic
Fixes silent auto-updates hanging when the previous version's uninstaller fails. The NSIS installer now defines
customUnInstallCheckandcustomUnInstallCheckCurrentUserto reproduce electron-builder's default handling with/SD IDOKadded, so a silent run fails at once with error level 2 instead of waiting on a dialog the user didn't start. Interactive installs still show the "Failed to uninstall" dialog. A new test pins the upstreamhandleUninstallResultso an electron-builder upgrade that changes it fails the test.Written for commit 154722b. Summary will update on new commits.