Skip to content

feat(updater): default to startup install + installer UI on Windows#1097

Merged
Kosinkadink merged 3 commits into
mainfrom
feat/default-startup-install-windows
Jun 13, 2026
Merged

feat(updater): default to startup install + installer UI on Windows#1097
Kosinkadink merged 3 commits into
mainfrom
feat/default-startup-install-windows

Conversation

@Kosinkadink

Copy link
Copy Markdown
Member

Summary

Commits to the install-on-startup update flow with the NSIS installer UI shown as the default behavior on Windows (issue #1065).

Both installUpdatesOnStartup and showInstallerUI were previously hidden, opt-in flags (default off) used to canary the new path. They are now default-on on Windows, mirroring the existing autoInstallUpdates opt-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 false in settings.json to 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.tsisStartupInstallEnabled() and isInstallerUIEnabled() 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.

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>
@coderabbitai

coderabbitai Bot commented Jun 13, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: 20d0ee06-2f15-4406-863a-e52d097e6237

📥 Commits

Reviewing files that changed from the base of the PR and between b45076e and b357440.

📒 Files selected for processing (2)
  • src/main/lib/updater.test.ts
  • src/main/lib/updater.ts

📝 Walkthrough

Walkthrough

This 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 false. Tests and JSDoc/comments were updated to reflect the new default-on semantics.

A tiny toggle, no smoke — just opt-out, not opt-in; a subtle win with a cheeky grin.

Changes

Windows Update Default Behavior Flip

Layer / File(s) Summary
Settings JSDoc and test header comments
src/main/settings.ts, src/main/lib/updater.test.ts
Rewrites JSDoc for installUpdatesOnStartup and showInstallerUI to clarify Windows-only opt-out semantics; updates test header/comments to reference Option C and NSIS UI default-on behavior.
Startup-install opt-out gate and register/suppress tests
src/main/lib/updater.ts, src/main/lib/updater.test.ts
Adds isWindowsOptOutGate() and changes isStartupInstallEnabled() to treat any value other than false as enabled; updates register() and suppressInstallOnQuit() tests/comments to assert default-enabled startup staging disables install-on-quit and that installUpdatesOnStartup = false preserves install-on-quit.
Installer-UI opt-out gate and installUpdate tests
src/main/lib/updater.ts, src/main/lib/updater.test.ts
Changes isInstallerUIEnabled() to opt-out semantics and flips installUpdate() tests to expect non-silent (UI shown) by default, with silent install only when showInstallerUI is false; updates related isSilent comments.

Sequence Diagrams

No 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

  • deepme987
🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/default-startup-install-windows
✨ Simplify code
  • Create PR with simplified code
  • Commit simplified code in branch feat/default-startup-install-windows

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

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot requested a review from deepme987 June 13, 2026 06:29

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 1d59d06 and 71b28d7.

📒 Files selected for processing (3)
  • src/main/lib/updater.test.ts
  • src/main/lib/updater.ts
  • src/main/settings.ts

Comment thread src/main/lib/updater.test.ts Outdated
Comment thread src/main/lib/updater.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>
@Kosinkadink Kosinkadink merged commit 68bed80 into main Jun 13, 2026
11 checks passed
@Kosinkadink Kosinkadink deleted the feat/default-startup-install-windows branch June 13, 2026 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants