Skip to content

Windows in-app updater: download, staged install, relaunch - #446

Merged
coneilen merged 1 commit into
mainfrom
coneilen-microsoft-windows-in-app-updater
Sep 24, 2026
Merged

coneilen merged 1 commit into
mainfrom
coneilen-microsoft-windows-in-app-updater

Conversation

@coneilen

Copy link
Copy Markdown
Collaborator

Windows in-app updater: download, staged install, relaunch

Implements the in-app Windows updater (download → checksum verify → extract →
staged install → Relaunch Now/Later), matching macOS behaviour, and unblocks
the Install progress / Relaunch prompt rows in investigation/ui-parity-matrix.md
plus advances Available update alert.

What changed

  • graphcode-windows/src/WindowsUpdateInstall.zig (new): download over HTTPS
    with progress reporting, SHA-256 checksum verification (reusing the release
    pipeline's checksum-sidecar format), ZIP extraction, and invocation of the
    existing GraphCode-Setup.ps1 -Command Upgrade — reusing the packaging
    layer's shared verification/rollback logic rather than a second copy.
  • graphcode-windows/src/UpdateInstallDialog.zig (new): native in-window
    progress indicator (download %, verifying, extracting, installing) and the
    post-install Relaunch Now / Later prompt with session-continuity copy, plus
    a failure state.
  • graphcode-windows/src/UpdateOfferDialog.zig: Install is now conditionally
    enabled (buttonsFor(installable)) based on whether the real feed check
    resolved a Windows asset URL, instead of being permanently disabled with a
    "not implemented" label.
  • graphcode-windows/src/App.zig: wires the offer dialog's new .install
    action to runInstall()/relaunchAfterUpdate(); structural change to a
    shared file (new fields + two new methods on App), flagged separately to
    the fleet coordinator.
  • graphcode-windows/src/UpdateInstallLiveRunner.zig (new): a zig run-only
    driver (no test blocks, so outside the anti-drift guard) that exercises
    the real install() path against real HTTPS infrastructure for live
    evidence — not shipped in the app binary.
  • Tools/windows/Tests/WindowsUpdateInstall.Live.Tests.ps1 (new): standalone
    live-evidence script (network-using, intentionally not part of the
    hermetic WindowsShell.Tests.ps1 suite) that runs the real feed check and
    a real download+checksum-verify against a real GitHub release asset.
  • investigation/ui-parity-matrix.md: Available update alert and
    Install progress updated to Partial with honest evidence notes;
    Relaunch prompt moves from Blocked to Partial.

Honest evidence limits (please read before merging)

No Windows release asset currently exists on scgopi/GraphCode (re-confirmed
live at test time, not assumed) — only macOS DMGs are published. That means
the full download→extract→upgrade→relaunch happy path against a real
Windows ZIP cannot be exercised live in this PR, and neither can whether a
genuinely running graphcode-windows.exe can rename its own install
directory during self-update, or whether zmx sessions survive an
Upgrade-triggered daemon restart specifically. These are left honestly
Partial in the ledger rather than asserted Validated. What is live-proven:
a real HTTPS download of a real multi-megabyte GitHub asset streams genuine
progress and its SHA-256 is verified against the asset's real published
digest before extraction is attempted, and a deliberately wrong digest is
rejected with ChecksumMismatch strictly before extraction — proving the
checksum gate is not vacuous.

RED: zig run src\UpdateInstallLiveRunner.zig -- download-checksum https://github.com/scgopi/GraphCode/releases/download/v0.1.74/graphcode-macos-arm64.dmg 0000000000000000000000000000000000000000000000000000000000000000 -> result=error name=ChecksumMismatch, reached only as far as phase=verifying (never extracting), proving the check inspects real bytes
GREEN: pwsh Tools\windows\Tests\WindowsUpdateInstall.Live.Tests.ps1 -ZigExecutable $env:GRAPHCODE_ZIG0152 -> Windows update install live gate: PASS (real feed-check asset_url=none, real 21271139-byte download with 104 progress reports verified against the asset's real published sha256, wrong-digest rejection)
REGRESSION: pwsh Tools\windows\Tests\WindowsShell.Tests.ps1 -ZigExecutable $env:GRAPHCODE_ZIG0152 -> All 273 tests passed, Windows shell scaffold contract: PASS (42 source files executed)

…launch

Implements the Windows in-app updater matching macOS behaviour:
- WindowsUpdateInstall.zig: HTTPS download with progress, SHA-256 checksum
  verification, ZIP extraction, and invocation of the existing
  GraphCode-Setup.ps1 -Command Upgrade, reusing the existing packaging
  verify/rollback logic rather than a second implementation.
- UpdateInstallDialog.zig: native in-window progress indicator plus
  Relaunch Now/Later prompt with session-continuity messaging and a
  failure state.
- UpdateOfferDialog.zig: Install is now conditionally enabled based on
  whether the real feed check resolved a Windows asset URL, instead of
  a permanently-disabled not-implemented label.
- App.zig: wires the offer dialog's new .install action through
  runInstall()/relaunchAfterUpdate().
- UpdateInstallLiveRunner.zig + WindowsUpdateInstall.Live.Tests.ps1: real,
  non-simulated live evidence against real HTTPS infrastructure (GitHub
  API feed check, real asset download + checksum verify, and a
  deliberately-wrong-digest rejection proving the checksum gate is not
  vacuous).
- investigation/ui-parity-matrix.md: Available update alert / Install
  progress / Relaunch prompt updated with honest Partial evidence notes.

No Windows release asset is currently published (re-confirmed live), so
the full extract+upgrade+relaunch happy path against a real Windows ZIP
remains unproven and is left honestly Partial rather than asserted
Validated.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Signed-off-by: Colin Neilens <coneilen@microsoft.com>
@coneilen
coneilen force-pushed the coneilen-microsoft-windows-in-app-updater branch from 1ab3666 to e3b8bad Compare September 24, 2026 16:58
@coneilen
coneilen merged commit 1feffa6 into main Sep 24, 2026
10 checks passed
@coneilen
coneilen deleted the coneilen-microsoft-windows-in-app-updater branch September 24, 2026 17:38
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.

1 participant