Skip to content

Check for updates: download, verify and swap the executable - #15

Merged
geeooff merged 3 commits into
feat/i18nfrom
feat/updater
Nov 23, 2026
Merged

geeooff merged 3 commits into
feat/i18nfrom
feat/updater

Conversation

@geeooff

@geeooff geeooff commented Nov 23, 2026

Copy link
Copy Markdown
Owner

What

Help → Check for updates, in the same vein as GameModeExecutor's lot 13, adapted to a single executable and a modal window. The design record is in docs/updating.md.

  • Window: it checks the latest GitHub release, shows its notes, then offers Download and install (18.9 MB) and See it on GitHub. A progress bar follows, then Restart now, which is disabled while videos encode. The first start of the new version says Updated to X. Failures are shown in a sentence, with Try again and the release page.

  • Trust:

    • Only tags of the exact form vX.Y.Z are accepted; drafts and pre-releases are refused, and there is never a downgrade.
    • The SHA-256 must match both SHA256SUMS.txt and GitHub's asset digest, or the file is deleted.
    • Network access goes through ureq over rustls, with the OS trust store (rustls-platform-verifier) and Windows proxy settings.
    • The app connects only on the user's click.
  • Swap, GameModeExecutor's method (field-measured there):

    1. The download goes to <exe>.new beside the executable.
    2. Restart now writes updates\pending.txt, starts a hidden PowerShell and closes the window normally.
    3. The script runs Wait-Process -Id <pid> -Timeout 30, renames exe to .old and .new to exe (each step retried, against OneDrive or antivirus locks), then starts the exe.
    4. On failure it writes result.txt, puts the old exe back and starts it.
    5. The next start reports the outcome and tidies up.

    Paths reach the script only as single-quoted literals through -LiteralPath.

  • Code: update::Machine is pure and holds every rule; the window only draws it. Messages are in English and French.

  • New dependencies: ureq 3.5, sha2 0.11. about.toml accepts CDLA-Permissive-2.0, the licence of Mozilla's CA list in webpki-roots.

Field test (this machine, 2026-11-23)

A debug build pretending to be 0.9.0 (QVT_UPDATE_AS, debug only) ran from a scratch folder named update test [it's].

  • Update: check, download and verify, then restart. The result is the published 1.0.0 executable, byte for byte (a55a5f19…), which started in the foreground.
  • Rollback: with .old held open by another process, the swap failed after 10 retries. The old executable stayed and restarted, and showed The process cannot access the file….

Not measured: a proxy, and Updated to from a real release pair. 1.0.0 does not read pending.txt, so the first real pair is 1.1.0 → 1.2.0.

Checks

  • .\scripts\build.ps1 passes: 86 unit tests, including 14 for the updater (state machine, release parsing, an HTTP feed against a local listener, verification, script quoting, settling), plus the 3 end-to-end tests.
  • cargo about generate --fail passes with the new dependencies.

Based on feat/i18n (#12): the window's messages are localized. GitHub retargets this PR to main once #12 merges.

🤖 Generated with Claude Code

geeooff and others added 3 commits November 23, 2026 21:51
… the next start

Help > Check for updates opens a window: GitHub's latest release (tag vX.Y.Z only, never a downgrade), its notes, Download and install (ureq over rustls with the OS trust store and Windows proxy settings), SHA-256 checked against SHA256SUMS.txt and GitHub's asset digest, the file kept beside the executable as .new. Restart (refused while encoding) writes pending.txt and starts a hidden PowerShell that waits for this process, renames exe to .old and .new to exe with retries, restarts, and on failure writes result.txt, puts the old executable back and starts it (GameModeExecutor's measured method). The next start reports Updated or the failure and tidies. Machine is pure and tested; the HTTP feed against a local listener.

Field test on this machine: a debug build pretending to be 0.9.0 (QVT_UPDATE_AS) from a scratch folder with a space, an apostrophe and brackets updated itself to the published 1.0.0 (hash a55a5f19...); with the .old file held open, the swap failed after its retries, the old executable came back and reported why.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…roots' licence

docs/updating.md records the design, what is trusted and today's field measurements (update and rollback). README, changelog, architecture, AGENTS and the release skill follow. A failed swap now also deletes the unused download. CDLA-Permissive-2.0 (Mozilla's CA list in webpki-roots, through ureq) joins the accepted licences.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@geeooff
geeooff merged commit 3f6dc8a into feat/i18n Nov 23, 2026
2 checks passed
@geeooff
geeooff deleted the feat/updater branch November 23, 2026 20:58
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