From e0c829dd10f8607a6122f34f1fb11bd2ee9de1bf Mon Sep 17 00:00:00 2001 From: Local Dev Date: Wed, 9 Sep 2026 00:58:26 +0200 Subject: [PATCH] fix(theseus/updater): re-add --force-run so Theseus auto-relaunches after silent install MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit install-update-now was spawning setup with ['/S'] alone since the 0.3.31 rewrite. That installs correctly (E2E-proven multiple times this week) but leaves the user without a running browser after the install completes — the setup exits, and the user has to click the Start-menu shortcut to get Theseus back. --force-run is electron-builder's NSIS convention for 'start the app when the install finishes'; it makes the whole update feel like a seamless in-place restart. --updated stays out (was proven not to affect the install itself on our config). Reported by user 2026-09-09 after 0.3.37 → 0.3.39 auto-update ran cleanly but silently, with no post-install relaunch. --- main.js | 19 +++++++++++++------ package.json | 2 +- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/main.js b/main.js index 1f0972a7..f397d77d 100644 --- a/main.js +++ b/main.js @@ -3232,15 +3232,22 @@ ipcMain.handle("recheck-update", async () => { return { updateAvailable, currentVersion: app.getVersion() }; }); // One-click "Install & restart". Requires the silent pre-fetch to have -// finished (updateDownloadState === "ready"). Launches the setup with /S -// (skips the wizard; our nsis/installer.nsh's Ariadne prompt is bypassed -// too on upgrades because the Ariadne registry key is already present), -// then quits Theseus so the installer can overwrite it. When the installer -// finishes, the user re-launches Theseus and lands on the new version. +// finished (updateDownloadState === "ready"). Launches the setup with +// /S (silent, skips the wizard) and --force-run (electron-builder's NSIS +// convention for "start the app when the install finishes"), then quits +// Theseus so the installer can overwrite it. The user sees the browser +// disappear for a couple of seconds and come back on the new version — +// no manual relaunch needed. Verified E2E on 0.3.33 → 0.3.34 in the +// 2026-09-08 session; the 0.3.37 → 0.3.39 update ran WITHOUT --force-run +// (the flag was dropped in the 0.3.31 rewrite once it was clear /S alone +// installs correctly) and the user reported the missing relaunch — this +// commit puts --force-run back on so the auto-restart is part of the +// standard flow again. --updated stays out: the earlier E2E showed it +// wasn't load-bearing correctness for our NSIS config. ipcMain.handle("install-update-now", () => { if (updateDownloadState !== "ready" || !updateDownloadPath) return false; try { - const p = spawn(updateDownloadPath, ["/S"], { detached: true, stdio: "ignore" }); + const p = spawn(updateDownloadPath, ["/S", "--force-run"], { detached: true, stdio: "ignore" }); p.unref(); } catch (e) { console.warn("update spawn failed:", e?.message); return false; } // Give the child a moment to inherit our arguments before we exit. diff --git a/package.json b/package.json index b5555d46..9a17f7e8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "theseus-navigator", - "version": "0.3.39", + "version": "0.3.40", "description": "Theseus Navigator — a browser that follows the thread. By Silent Mode, a Deviant project.", "author": "Silent Mode", "main": "main.js",