Skip to content

Record your screen, ship a demo. Free and open-source, GPU-accelerated, no watermarks, no subscriptions. Windows, macOS, Linux. Actively maintained.

fix(updater): install Windows updates silently so only UAC shows

EtienneLescot8369d657432c
diff --git a/electron/auto-updater.test.ts b/electron/auto-updater.test.ts
index 3f60a2ec2..5346668c5 100644
--- a/electron/auto-updater.test.ts
+++ b/electron/auto-updater.test.ts
@@ -148,11 +148,10 @@ describe("self-update flow", () => {
expect(result).toMatchObject({ error: { message: "connection reset" } });
});
- // isSilent=false so a per-machine Windows install can show its UAC prompt — a silent upgrade
- // of a Program Files install hits elevation and, if dismissed, quits having done nothing.
- // isForceRunAfter=true so the app comes back.
- it("hands over to the installer non-silently and relaunches", async () => {
+ // isSilent=true so Windows shows only UAC, not the NSIS wizard (#1437). isForceRunAfter=true
+ // so the app comes back.
+ it("hands over to the installer silently and relaunches", async () => {
await installSelfUpdate();
- expect(mocks.autoUpdater.quitAndInstall).toHaveBeenCalledWith(false, true);
+ expect(mocks.autoUpdater.quitAndInstall).toHaveBeenCalledWith(true, true);
});
});
diff --git a/electron/auto-updater.ts b/electron/auto-updater.ts
index fdee80d2b..8153026af 100644
--- a/electron/auto-updater.ts
+++ b/electron/auto-updater.ts
@@ -85,8 +85,10 @@ export async function downloadSelfUpdate(): Promise<UpdateOutcome> {
/** Quit and hand over to the installer. Callers MUST have checked `blockedFromInstalling`. */
export async function installSelfUpdate(): Promise<void> {
const autoUpdater = await getUpdater();
- // isSilent=false so a per-machine Windows install can show its elevation prompt: a silent
- // upgrade of a Program Files install hits UAC and, if the user dismisses it, quits having
- // done nothing. isForceRunAfter=true so the app comes back up.
- autoUpdater.quitAndInstall(false, true);
+ // isSilent=true: without /S the assisted NSIS installer shows its whole wizard, starting on
+ // the install-mode page, which can pick the wrong copy when two installs coexist (#1437).
+ // A silent upgrade of a per-machine install still elevates itself (UAC_RunElevated in
+ // electron-builder's installer.nsi), so the user sees only the UAC prompt; dismissing it
+ // quits having installed nothing. isForceRunAfter=true so the app comes back up.
+ autoUpdater.quitAndInstall(true, true);
}