Repository navigation
Check for updates: download, verify and swap the executable - #15
Merged
Merged
Conversation
… 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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
vX.Y.Zare accepted; drafts and pre-releases are refused, and there is never a downgrade.SHA256SUMS.txtand GitHub's assetdigest, or the file is deleted.ureqover rustls, with the OS trust store (rustls-platform-verifier) and Windows proxy settings.Swap, GameModeExecutor's method (field-measured there):
<exe>.newbeside the executable.updates\pending.txt, starts a hidden PowerShell and closes the window normally.Wait-Process -Id <pid> -Timeout 30, renamesexeto.oldand.newtoexe(each step retried, against OneDrive or antivirus locks), then starts the exe.result.txt, puts the old exe back and starts it.Paths reach the script only as single-quoted literals through
-LiteralPath.Code:
update::Machineis pure and holds every rule; the window only draws it. Messages are in English and French.New dependencies:
ureq3.5,sha20.11.about.tomlaccepts CDLA-Permissive-2.0, the licence of Mozilla's CA list inwebpki-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 namedupdate test [it's].a55a5f19…), which started in the foreground..oldheld 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.ps1passes: 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 --failpasses with the new dependencies.Based on
feat/i18n(#12): the window's messages are localized. GitHub retargets this PR tomainonce #12 merges.🤖 Generated with Claude Code