Skip to content

fix(updater): ship signed NSIS installer so Windows auto-update installs (#96) - #97

Merged
amirlehmam merged 1 commit into
amirlehmam:masterfrom
Rajveerx11:fix/windows-nsis-autoupdate
Jul 16, 2026
Merged

fix(updater): ship signed NSIS installer so Windows auto-update installs (#96)#97
amirlehmam merged 1 commit into
amirlehmam:masterfrom
Rajveerx11:fix/windows-nsis-autoupdate

Conversation

@Rajveerx11

@Rajveerx11 Rajveerx11 commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Closes #96.

The problem

On Windows the app detects and downloads updates, but can never install them. The release ships a .zip (wmux-<ver>-win-x64.zip) as the update artifact. electron-updater on Windows uses NsisUpdater, which installs by running an NSIS .exe — it has no path to apply a zip. So the download and checksum both succeed (it looks like it's working), but quitAndInstall() no-ops and the app relaunches on the same version. The updater's own comment already flags the zip as the acknowledged follow-up (#71).

The fix

Ship a real NSIS installer whose hashes match latest.yml:

  • electron-builder.json — switch win.target from dir to nsis (the nsis block was already configured) and add a space-free artifactName (wmux-${version}-setup.exe).
  • release.yml — build the installer (drop --dir), retarget the SignPath signing steps at the installer, remove the manual Compress-Archive zip, and generate latest.yml last, from the signed installer, so its sha512 matches the exact file that ships. The redundant rcedit step is removed — electron-builder already embeds win.icon, the version, and FileDescription (taskbar-pinning name) into the packaged exe.
  • Regression test — asserts the Windows target is nsis, not dir/zip, so this can't silently regress.

Respecting the signing sequencing (#32)

Per #32, an NSIS installer isn't worth shipping until code-signing is live, since (a) unsigned NSIS trips SmartScreen harder than a zip, and (b) with win.publisherName pinned to SignPath Foundation, electron-updater now Authenticode-verifies the downloaded installer — an unsigned NSIS installer would fail that check and the update would throw.

So this PR is designed to degrade gracefully and is gated behind active signing:

Net: merge-safe now (auto-update simply stays dormant while unsigned), and it starts working the moment signing is live.

Notes for review

  • SignPath config: the submit still uses artifactConfigurationSlug=initial, which was set up for the old unpacked wmux.exe. Submitting the installer .exe may need that artifact configuration updated on the SignPath side. It's non-fatal (continue-on-error), but worth checking when quota returns.
  • Build env: NSIS is built in CI (windows-latest, clean path) — the OneDrive - Pulsa spaced-path winCodeSign issue from CLAUDE.md doesn't apply on the runner.
  • No .blockmap is emitted, so updates are full downloads (verified by the top-level sha512) rather than differential — correct, just not delta-optimized.

Testing

  • npm test — full suite green (211 passed), including the new target guard.
  • Verified every workflow reference resolves to release/wmux-<ver>-setup.exe (signing submit/download/verify, latest.yml, artifact upload, release upload).

The Windows release shipped a .zip, which electron-updater's NsisUpdater can
download and checksum-verify but has no way to install — quitAndInstall()
no-ops and the app relaunches on the same version (issue amirlehmam#96).

- electron-builder: switch win.target from `dir` to `nsis` (the nsis block was
  already configured); add a space-free artifactName.
- release.yml: build the installer, retarget SignPath signing + latest.yml at
  the installer, drop the manual zip, and generate latest.yml LAST from the
  signed installer so its sha512 matches the shipped file.
- Only publish latest.yml when signing succeeds: with win.publisherName pinned
  to "SignPath Foundation", electron-updater Authenticode-verifies the
  downloaded installer, so an unsigned NSIS installer would fail the update.
  Unsigned releases still ship the installer for manual download but don't
  advertise an auto-update (graceful no-op instead of a broken one).
- Add a regression test asserting the Windows target is nsis, not dir/zip.

Per amirlehmam#32 this is gated on active code-signing (unsigned NSIS also trips
SmartScreen harder than a zip); it activates automatically once the SignPath
OSS quota is restored (amirlehmam#71), with no further changes.

Closes amirlehmam#96

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@amirlehmam
amirlehmam merged commit 4ddf167 into amirlehmam:master Jul 16, 2026
amirlehmam added a commit that referenced this pull request Jul 16, 2026
….26.0

PR #97 switched the release artifact to an NSIS installer so auto-update
can actually install (#96), but dropped the portable zip that the docs
and wmux.org point users at. Restore it as an additional release asset;
latest.yml keeps pointing at the installer only.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MQkPd2DNXsM2AaKqiLdZFh
@amirlehmam

Copy link
Copy Markdown
Owner

Merged and shipped in v0.26.0 — thank you, the analysis in this PR (and #96) was spot-on, including the reasoning for gating latest.yml on signing.

Two follow-up commits on master after the merge:

  • 5a2be62 restores the portable zip as an additional release asset — the docs and wmux.org point users at wmux-X.Y.Z-win-x64.zip, and it's the SmartScreen-friendliest artifact. latest.yml still points only at the installer, exactly as you set it up.
  • 120edd5 — the first v0.26.0 run surfaced that the SignPath project currently signs with a self-signed cert (CN=Amir Lehmam), which Get-AuthenticodeSignature reports as UnknownError and your (correctly) fatal verify step killed the whole release. The verify step now marks the artifact trusted/untrusted instead of failing, ships it either way, and only publishes latest.yml when chain-trusted — same invariant you designed, just tolerant of the self-signed case.

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.

Auto-updater downloads but never installs on Windows — app stays on old version

2 participants