fix(updater): per-user NSIS Windows updates + skip auto-update in dev - #169
Closed
its-mash wants to merge 1 commit into
Closed
fix(updater): per-user NSIS Windows updates + skip auto-update in dev#169its-mash wants to merge 1 commit into
its-mash wants to merge 1 commit into
Conversation
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>
Member
Author
|
Consolidated into #171 per request (single branch, trimmed descriptions). |
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.
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
quietmode. Per-machine MSI upgrades need elevation;quietsuppresses the UAC prompt; apps run non-elevated by default — so the silent install failed (1603/ "must be Administrator",1730). BecausedownloadAndInstall()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 justpnpm dev.Changes (
apps/desktop/src-tauri/tauri.conf.json,apps/desktop/src/App.tsx)msifrombundle.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.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.comresolver (pinManifestUrls) rewrites manifest URLs filename-agnostically (path prefix only), so once releases build NSIS-only,latest.jsonwill reference the-setup.exeand 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 valuepreinstead ofprerelease), not a resolver bug.Tests
Appupdate-banner suite stubsimport.meta.env.DEV=falseto keep exercising the production flow — all 12 pass.tsc --noEmitclean; 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.exeto fully migrate off the per-machine install.Follow-up (not in this PR)
.msiasset URL (would 404 once MSI is no longer built).