feat(updater): default to startup install + installer UI on Windows#1097
Conversation
Flip installUpdatesOnStartup and showInstallerUI from opt-in (default off) to default-on on Windows, mirroring the autoInstallUpdates opt-out pattern (!== false). Windows now applies staged updates at startup (disabling the crash-prone electron-updater install-on-quit) and shows the NSIS progress window during the install. Set either setting to false in settings.json to opt back out. No-op on macOS/Linux. Amp-Thread-ID: https://ampcode.com/threads/T-019eb80f-cba2-715c-8d1c-b5d98540cbec Co-authored-by: Amp <amp@ampcode.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR flips two Windows update-install settings from opt-in to opt-out: startup-install staging and NSIS installer UI are now enabled by default unless explicitly set to A tiny toggle, no smoke — just opt-out, not opt-in; a subtle win with a cheeky grin. ChangesWindows Update Default Behavior Flip
Sequence DiagramsNo additional sequence diagrams generated beyond the hidden review artifact: changes are configuration-gate flips and test/comment updates with limited cross-component choreography. Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install timed out. The project may have too many dependencies for the sandbox. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Amp-Thread-ID: https://ampcode.com/threads/T-019eb80f-cba2-715c-8d1c-b5d98540cbec Co-authored-by: Amp <amp@ampcode.com>
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/main/lib/updater.test.ts`:
- Around line 315-317: Replace any "Option B"/"Option C" phrasing in the updater
tests and comments with explicit behavior-based wording that describes the
observable behavior (e.g., "startup install default-on", "startup install opted
out", "NSIS installer UI default on", etc.). In the test file update the inline
comments around the test fixtures (the block initializing listeners = {}) and
any nearby test descriptions so they describe the behavior rather than
plan/option codes; search the file for occurrences of "Option B" or "Option C"
and change them to the appropriate behavior label, and update any related
assertion messages to match the new wording.
In `@src/main/lib/updater.ts`:
- Around line 147-150: Both isStartupInstallEnabled and isInstallerUIEnabled
duplicate the same Windows + settings !== false gate; extract a small shared
helper (e.g., isWindowsFeatureEnabled or isWindowsOptOutGate) that returns
process.platform === 'win32' && settings.get(key) !== false and have
isStartupInstallEnabled and isInstallerUIEnabled call that helper with their
respective setting keys so the logic is centralized and cannot drift.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 54f0f44e-19af-4c76-a6c6-0e2ff61f1d50
📒 Files selected for processing (3)
src/main/lib/updater.test.tssrc/main/lib/updater.tssrc/main/settings.ts
Addresses CodeRabbit review on #1097: - Extract isWindowsOptOutGate() so the startup-install and installer-UI gates share one win32 + setting !== false check (no drift). - Replace plan-reference 'Option B/C' wording in tests/comments with behavior-based descriptions. Amp-Thread-ID: https://ampcode.com/threads/T-019eb80f-cba2-715c-8d1c-b5d98540cbec Co-authored-by: Amp <amp@ampcode.com>
Summary
Commits to the install-on-startup update flow with the NSIS installer UI shown as the default behavior on Windows (issue #1065).
Both
installUpdatesOnStartupandshowInstallerUIwere previously hidden, opt-in flags (default off) used to canary the new path. They are now default-on on Windows, mirroring the existingautoInstallUpdatesopt-out pattern (!== false):installUpdatesOnStartup— staged updates now apply at the next launch and electron-updater's crash-prone install-on-quit is disabled entirely. This is the core fix for the Windows shutdown-corruption loop in Automatic desktop update (applied on shutdown) currently might not play nice with Windows shutdowns. #1065.showInstallerUI— the NSIS progress window is shown during the install (isSilent: false), giving continuous visual feedback during the file copy that the Electron "Updating…" splash can't cover (the copy runs after the app quits).Set either setting to
falseinsettings.jsonto opt back out. No-op on macOS/Linux, whose updaters don't have the NSIS shutdown-corruption failure mode.Why now
The startup-install path and installer UI were validated via the hidden flags across prior PRs (#1066, #1079, #1088, #1093). Both per-user and all-users update flows were manually confirmed working. This PR makes that path the committed default for Windows users.
Changes
src/main/lib/updater.ts—isStartupInstallEnabled()andisInstallerUIEnabled()flipped to default-on (!== false), docs updated.src/main/settings.ts— setting doc comments updated to reflect default-on / opt-out.src/main/lib/updater.test.ts— tests updated for the new defaults; added explicit opt-out coverage.Validation
pnpm exec vitest run src/main/lib/updater.test.ts✅ (33 passed)pnpm run typecheck✅pnpm run lint✅pnpm run build✅Final real-world confirmation still requires a ToDesktop Windows build to exercise the live update path.