Skip to content

fix(updater): per-user NSIS Windows updates + skip auto-update in dev - #169

Closed
its-mash wants to merge 1 commit into
mainfrom
fix/windows-updater-nsis-per-user
Closed

fix(updater): per-user NSIS Windows updates + skip auto-update in dev#169
its-mash wants to merge 1 commit into
mainfrom
fix/windows-updater-nsis-per-user

Conversation

@its-mash

Copy link
Copy Markdown
Member

What

Fixes the Windows auto-updater so it no longer requires admin and no longer "crashes" (the app exiting to apply an update it can't apply), and stops dev builds from auto-updating over your local changes.

Root cause

The updater shipped a per-machine MSI installed in quiet mode. Per-machine MSI upgrades need elevation; quiet suppresses the UAC prompt; apps run non-elevated by default — so the silent install failed (1603 / "must be Administrator", 1730). Because downloadAndInstall() quits the app to apply the update, it looked like a crash/loop. This hit any non-elevated user on auto-update (auto-install defaults to on), not just pnpm dev.

Changes (apps/desktop/src-tauri/tauri.conf.json, apps/desktop/src/App.tsx)

  • Drop msi from bundle.targets (was "all" → explicit list). Windows now ships NSIS only, already configured per-user (nsis.installMode: "currentUser"), so updates install without elevation.
  • installMode: "quiet""passive" — shows a small progress UI and surfaces a UAC prompt if elevation is ever needed, instead of failing invisibly. With per-user NSIS the normal path still needs no elevation.
  • Skip the startup auto-update under pnpm dev (if (import.meta.env.DEV) return;) — a dev build would otherwise detect a newer published release, install it over the dev build, and relaunch, so local changes never appear. Production unaffected.

No worker change needed

The api.mcpmux.com resolver (pinManifestUrls) rewrites manifest URLs filename-agnostically (path prefix only), so once releases build NSIS-only, latest.json will reference the -setup.exe and the resolver passes it straight through. Verified the prerelease channel resolves correctly (0.4.0-191) — an earlier "wrong version" observation was a bad manual test (header value pre instead of prerelease), not a resolver bug.

Tests

App update-banner suite stubs import.meta.env.DEV=false to keep exercising the production flow — all 12 pass. tsc --noEmit clean; ESLint clean (only pre-existing warnings); clippy/fmt clean via pre-commit.

Takes effect

On the next release build (the artifact type is decided at build time). Existing per-machine MSI installs will likely need one manual reinstall via the NSIS -setup.exe to fully migrate off the per-machine install.

Follow-up (not in this PR)

  • Verify the discover.ui download page doesn't hardcode a .msi asset URL (would 404 once MSI is no longer built).

The Windows auto-updater shipped a per-machine MSI installed silently
(installMode "quiet"). Per-machine MSI upgrades need elevation; "quiet"
suppresses the UAC prompt and apps run non-elevated by default, so the
silent install failed (1603 / "must be Administrator") for ordinary
users — and since the app quits to apply the update, it looked like a
crash/loop. This affected any non-elevated user on auto-update, not just
dev.

- bundle.targets: drop "msi" (was "all"). Windows now ships NSIS only,
  which is already configured per-user (nsis.installMode "currentUser")
  — so updates install without elevation. The updater manifest will
  reference the NSIS "-setup.exe"; the api.mcpmux.com resolver rewrites
  URLs filename-agnostically, so no worker change is needed.
- updater.windows.installMode: "quiet" -> "passive". Shows a small
  progress UI and, crucially, surfaces a UAC prompt if elevation is ever
  needed instead of failing invisibly. With per-user NSIS the normal
  path still needs no elevation.
- App.tsx: skip the startup auto-update entirely when import.meta.env.DEV
  (i.e. under `pnpm dev`) — otherwise a dev build detects a newer
  published release, installs it over the dev build, and relaunches, so
  local changes never appear. Production builds are unaffected.

Tests: App update-banner suite stubs DEV=false to keep exercising the
production flow; all 12 pass.

Signed-off-by: Mohammod Al Amin Ashik <maa.ashik00@gmail.com>
@its-mash

Copy link
Copy Markdown
Member Author

Consolidated into #171 per request (single branch, trimmed descriptions).

@its-mash its-mash closed this Jun 15, 2026
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.

1 participant