Repository navigation
feat(updater): in-place updates for portable zip installs - #184
Conversation
NSIS-based electron-updater cannot replace a zip extract (issue amirlehmam#96): latest.yml pointing at a zip loops, and setup.exe would install a second copy. The README-recommended install is the zip, so the titlebar badge and a new Help-panel button now download the win-x64 zip, extract it, and swap over the install folder after wmux exits. The download uses Electron net.request (no Invoke-WebRequest progress tax). NSIS installs keep the existing electron-updater path.
Download already uses Electron net.request, not curl. Point extract/apply at %SystemRoot%\System32 so a missing or hijacked PATH cannot break a portable zip update, and treat Unblock-File as best-effort.
|
Merged, and shipping in v1.7.0 (release build running now). Thanks — this is the piece #96 and #125 were missing. Those two got the badge right but left the README install, the one the docs actually tell people to download, as the one layout that couldn't self-update. Routing by install layout instead of trying to make What I verified before merging
One thing I changed on merge
The failure branch now falls through to the same relaunch as the happy path, skipping only the MOTW strip: A failed copy usually leaves the old build in place, so Same commit flattens Follow-ups, not blockers
One note for anyone reading this later: nobody on <= 1.6.0 gets the new path, since the code doing the swap ships in the update. Zip extracts have to take one more manual trip to the releases page to reach 1.7.0, and self-update from there on. |
…n i18n TRACE rows inherited classic's vertical rhythm, which was sized for a title plus one status line. TRACE routinely stacks four or five lines, so a three-session workspace was a ~114px block and a handful of them filled the sidebar. Compacts the leading only — no glyph, dot or label is hidden or truncated, and type stays at 10px/9.5px. 114px -> 89px per row (-22%). The 13px session line is the floor: below that the 5px status dot and its 1px via stop sitting on the optical centre of the line box. Also completes settings.help.checkUpdate / updateTo / upToDate / downloading across the 16 locales PR #184 left on the English fallback. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0156K5nxrn7jMBNq8LSNY2Pa
Summary
In-place updates for portable zip extracts — the README-recommended install. NSIS installs are untouched.
Follow-up to #96 and #125. Those shipped an in-app path through
electron-updater'sNsisUpdater, which can replace an NSIS install. A zip extract (noUninstall wmux.exenext towmux.exe) still cannot: listing the zip inlatest.ymlis the endless "update ready" loop from #96, and listingsetup.exewould install a second copy under%LOCALAPPDATA%while leaving the zip folder on the old version. Clicking the badge then fell back to the GitHub release page (#125).This PR gives zip extracts their own download → extract → swap path, driven by the same badge click and a new Check for updates button next to the version in Settings → Help.
Zip only
Detection is conservative, so NSIS behaviour does not change:
wmux-*-setup.exe)Uninstall wmux.exenext towmux.exeNsisUpdater(quarantine,latest.yml,quitAndInstall)wmux-*-win-x64.zip)wmux.exe, no uninstallernpm run dev/WMUX_DISABLE_UPDATER=1handled: false→ GitHub releases pageinitAutoUpdater()returns before registeringNsisUpdateron a zip extract, so a portable install can never enter the #96 loop. Zip updates are user-initiated only (badge / Help button). There is no unattended zip download; the 3-day quarantine window continues to apply only to the NSIS path.Runtime tools (no curl, no extra npm deps)
The download does not use
curl.exeorInvoke-WebRequest(the latter's progress callback is what made large zips crawl). Packaged Electron already has Chromium networking.electron.net.request%SystemRoot%\System32\tar.exe, then Windows PowerShellExpand-Archivetar.exeships with Windows 10 1803+, which Electron 43 already requires; PowerShell is the fallbackcmd.exe+robocopy/tasklist/timeout/findstrvia%SystemRoot%\System32PATHUnblock-FileIntegrity: GitHub
asset.sizeplusdigest(sha256:…) when the API sends it. The payload is rejected if it does not containwmux.exe.UI
latest.ymlis an NSIS artifact.Tests
tests/unit/zip-updater.test.ts— portable vs NSIS detection, win-x64 asset pick, payload root, helper script.tests/unit/updater.test.ts— zip extracts do not callNsisUpdater; already-current zip reportsno_update; NSIS path unchanged.npx vitest run tests/unit/updater.test.ts tests/unit/zip-updater.test.ts— 36 passed.npm run typecheckclean.