Skip to content

Auto-update: update dialog, Windows/Linux self-update, macOS Sparkle (nightlies first) - #819

Merged
peiikai merged 9 commits into
developfrom
feature/auto-update
Nov 16, 2026
Merged

peiikai merged 9 commits into
developfrom
feature/auto-update

Conversation

@peiikai

@peiikai peiikai commented Nov 16, 2026

Copy link
Copy Markdown
Owner

Auto-update, nightlies first.

What changes

  • The start screen's update link looks as before. Clicking it opens a dialog with what's new since this build (every skipped release's notes, without the warning banner and sha256 table; for nightlies, the PRs merged since this build) and Update / Download / Back. Download (the release page) always works, also if Update ever breaks. Phones and tablets: Download only.
  • Windows (x64, ARM) and Linux AppImage update themselves: a signed manifest (update-<platform>.txt, Ed25519 via Monocypher, CC0) lists the file and, for zips, every app file with its sha256. Only those files are swapped, journaled, then the app restarts. Saves, seeds, settings and game files in the Windows exe folder are never touched. The old files stay until the new version reaches the start screen (or boots the game); a new version that never gets there is rolled back on the next start. Not writable / not an AppImage: Update off, Download stays.
  • macOS uses Sparkle 2.10.1 (MIT): one background check at launch, its own windows, a feed per channel (releases/latest/download/appcast-macOS.xml, releases/download/nightly/appcast-macOS.xml), EdDSA with the same key. The dialog's Update asks Sparkle to check. Nightly bundle versions now carry their stamp so each round is newer to Sparkle.
  • release.yml and nightly.yml publish the manifests and the Mac feed (signed with the UPDATE_SIGNING_KEY secret; without it they only warn). nightly.yml also lists merged PR titles per round under "Changes" (last 30 rounds). Asset names and tag formats unchanged.
  • Rollout: only nightlies get Update. Release builds stay Download-only until LARECOMP_UPDATE_RELEASES in launcher.mm is set to 1. No AppImage zsync yet.
  • New text translated in every table.

Tests

  • tools/test_update.cpp (manifest, signature, unsafe paths, swap stopped at every step, rollback, read-only folder) and tools/test_update_e2e.sh (AppImage path against a local server, 22 checks) run in CI; the unit test on Windows too. Changelog and bundle version tests in tools/test_update_tags.cpp.
  • macOS (Apple Silicon): dialog screenshot; two ad-hoc signed bundles of the app updated through Sparkle from a local feed and relaunched; a broken EdDSA signature refused.
  • Windows x64 (RTX 3080 Ti, two make dist builds, local server): update, automatic restart, kept at the start screen, rollback of a version that never got there, bad signature refused; fake saves, seeds and game files untouched; the new version gets its own session log. This found two bugs, fixed here: CRLF manifests from update_sign on Windows, and the restarted version inheriting the old one's log.
  • Linux arm64 (Debian 13, clang 19): both tests pass, no warnings.
  • Not tested yet: Windows on ARM, a real AppImage update (left for the first nightly testers).

After merging
nightly.yml and tools/nightly_publish.sh also need the matching change on main (scheduled nightlies run from there); that's a separate PR.

🤖 Generated with Claude Code

peiikai and others added 9 commits November 15, 2026 18:16
Every Windows and Linux release file gets a manifest (update-<platform>.txt): its version,
platform, size and sha256, and for the zips every app file inside, signed with one Ed25519 key
(Monocypher 4.0.2, CC0, vendored in third_party/monocypher). tools/update_sign.cpp makes the key,
the manifests and the Sparkle signatures for macOS; tools/update_manifest.sh runs it in
release.yml and nightly.yml with the UPDATE_SIGNING_KEY secret, and only warns when the secret
is missing, so builds keep shipping without it.

nightly.yml also lists the pull requests merged since the previous round under "Changes" in the
nightly notes, keeping the last 30 rounds, for the start screen's update dialog. Asset names and
tag formats are unchanged; the manifests' names never match a nightly file.

Test: tools/test_update.cpp (manifest parse, signature, unsafe paths, swap and rollback).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
runtime/update.cpp downloads the platform's manifest and file, checks the signature and every
sha256, then swaps only the files the manifest lists (on Windows the data folder is the exe's
folder: saves, seeds, settings and game files are never touched), journaled so a swap cut off
halfway is undone on the next start. The app restarts into the new version; the old files stay
until it reaches the start screen (or boots the game), and a new version that never gets there
is rolled back on the next start. Not writable, or not run as an AppImage: Update is off,
Download remains.

Tests: tools/test_update_e2e.sh runs the AppImage path against a local web server (update,
restart, keep, rollback; bad signature, truncated and damaged downloads, wrong platform or
version, missing files, read-only folder). Both tests run in CI, the unit test on Windows too.
The real public key is still a placeholder until the signing key exists.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The update link looks as before; clicking it opens a dialog with what's new since this build:
the notes of every release skipped (without the warning banner, "Built from" line and sha256
table), or for nightlies the Changes rounds newer than this build. Buttons: Update (Windows and
Linux nightlies for now; release builds get it with LARECOMP_UPDATE_RELEASES), Download (the
release page, always there) and Back. Phones and tablets: Download only.

Test hooks LARECOMP_UPDATE_JSON / LARECOMP_UPDATE_OPEN; changelog tests in
tools/test_update_tags.cpp. New strings translated in every table.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sparkle 2.10.1 (MIT, tools/fetch_sparkle.sh, pinned sha256) goes into the app as released, its own
ad-hoc signatures kept; the app loads it at the start screen and checks once in the background
at launch (Sparkle's own schedule is off, so no rechecks while running and no permission prompt).
The update dialog's Update button asks Sparkle to check now, which shows Sparkle's own window.
Feeds per channel: releases/latest/download/appcast-macOS.xml for releases,
releases/download/nightly/appcast-macOS.xml for nightlies, made and EdDSA-signed with the same key
as the manifests (tools/sparkle_appcast.sh in release.yml and nightly.yml). Nightly bundle
versions now carry their stamp so each round is newer to Sparkle. Until the key exists the app
gets no feed and Sparkle stays off; release builds keep Download only (LARECOMP_UPDATE_RELEASES).

Checked beforehand: Sparkle 2.10.1 installs an update into an ad-hoc signed app (EdDSA checked,
a bad signature refused), dmg and zip archives.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The key that signs every update manifest and Sparkle feed; its private half is the
UPDATE_SIGNING_KEY repo secret. tools/bundle_macos.sh derives Sparkle's SUPublicEDKey from it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
LARECOMP_SPARKLE_AUTOINSTALL=1 installs a downloaded update at once, as Sparkle's Install and
Relaunch does. Used to check the macOS path end to end on this build: two ad-hoc signed bundles
of the app, a local feed, Sparkle 2.10.1 updated the bundle in place and relaunched it (the app
quits cleanly when asked); a feed with a broken EdDSA signature was downloaded but not installed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Found in the first Windows test: update_sign wrote the manifest through stdout in text mode, so
every line ended in CR LF and every install refused it ("bad signature line"). stdout is binary
now; tools/update_manifest.sh reads each manifest back from the file and checks it as the app
would, so a broken one fails the build; the app names CR LF line ends when it refuses one.

The restarted new version inherited LASRECOMP_LOG_FILE and appended to the old version's session
log without its own header; it starts a session log of its own now.

Windows x64 test (Windows PC, steps per the request): update, automatic restart, the start
screen keeping it, rollback of a version that never got there, and a bad signature all passed
with the LF manifest; saves, seeds and game files untouched.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The restarted version inherited LASRECOMP_INFO_LOGGED (and would inherit the re-exec markers), so
its new session log had no "[info] LAS Recomp <version>" line. The restart now clears what a
process passes to its own relaunches, on Windows and Linux. Found in the Windows recheck, which
otherwise passed: an unmodified manifest from the fixed tool (no CR bytes) updated, restarted and
was kept, with the new version in its own session log.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@peiikai
peiikai merged commit b07265f into develop Nov 16, 2026
8 checks passed
@peiikai
peiikai deleted the feature/auto-update branch November 16, 2026 02:17
feiyunwill pushed a commit to feiyunwill/LASRecomp that referenced this pull request Nov 16, 2026
peiikai#819)

Scheduled nightlies run main's nightly.yml on develop's code, so main needs the
same file. The scripts it calls (update_manifest.sh, sparkle_appcast.sh,
nightly_publish.sh) come from the develop checkout.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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