Skip to content

linux appimage self update - #125

Merged
elripalda merged 7 commits into
elripalda:mainfrom
innateessence:feat/linux-appimage-self-update
Nov 13, 2026
Merged

elripalda merged 7 commits into
elripalda:mainfrom
innateessence:feat/linux-appimage-self-update

Conversation

@innateessence

@innateessence innateessence commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Series: launcher updates and Big Picture fixes. Merge one at a time, in this order. Each one stays a draft until the one before it is in.

  1. Big Picture B no longer dismisses a busy dialog #127 Big Picture: B no longer closes a busy dialog
  2. Big Picture: the launcher's own update gets a row on the Downloads page #139 Big Picture: Downloads gets a launcher update row
  3. Big Picture: What's New sized for the TV, and messages centred #140 Big Picture: What's New sized for the TV, messages centred
  4. Mac: the launcher updates itself from the release's disk image, with rollback #126 Mac: the launcher updates itself, with rollback
  5. linux appimage self update #125 Linux: the AppImage updates itself

This is 5 of 5. Rebased onto main after the other four. Three conflicts (checked by replaying the merges):


What this changes

Linux AppImages update themselves in place with a safer flow. Issue: #123

  • Checks the Linux entry's metadata (trusted HTTPS AppImage URL, its own sha256, a newer version), bounds the download to 512 MiB, and checks the type-2 AppImage container and runtime architecture before staging.
  • Stages beside the running AppImage. A system-shell helper waits for the launcher to exit (so the new one doesn't hand its window back to the old one's single-instance lock), swaps the file atomically, and reopens in the mode that was on screen (--bigpicture / new --desktop).
  • Restores the previous image if the new one exits with an error in its first two seconds.
  • The Linux entry no longer inherits the Windows sha256, min or size.

Maintainer changes

  • Failures go through the same path as Windows and Mac (2289519): update-pending.json is written before the handoff. When the old version is the one that starts next, it shows "The Update Didn't Start" with Try Again, and the second failure from the same file stops it being offered. The helper's own error file is gone; it notes what happened in launcher-trail.log.
  • A failed swap reopens the unchanged launcher instead of leaving no window (2289519).
  • A folder this account can't change is checked before the download. A window names the folder and offers the new AppImage to download, instead of a bare error (2289519).
  • Leftover staging folders from an interrupted update are removed at the next start once they're an hour old (2289519).
  • One trusted-download check (origin and path) for every platform's update URL, replacing the prefix check in update_launcher. It still lets RL_API point at a local copy of the site (2289519).
  • The old AppImage runtime exits after the update (e2852ae, b9d2226). The runtime hands every program it starts its mount (descriptor 1023) and the read end of a keepalive pipe, and its FUSE process stays up until no program holds that pipe. The helper inherited both and passed them to the new launcher, so the old runtime kept running until the new launcher closed (the updater in main does this too). Everything past stdio is now close-on-exec in the helper (close_range, Linux 5.11+). Upstream tracks the same kind of orphan in AppImage orphan survives main process exit AppImage/type2-runtime#92.
  • Docs (2b43028): docs/LAUNCHER-API.md covers the above, and that an update error now closes the progress dialog on every platform (on Windows it used to stay open).

How you tested it

By the author:

  • codex review against main with GPT 6.1 Sol on High
  • Ensure all tests pass
  • Change version number in a dirty edit on this branch
  • compile and run new AppImage with older version number
  • Trigger self update, and compare version number
  • Rerun the same binary, after manually killing all recomplauncher processes, to ensure the old binary was overwritten

By the maintainer, on Bazzite (KDE Plasma, Wayland) in a VM:

  • cargo test (445) and node --test tests/*.test.cjs (108) pass on Ubuntu 24.04 with the maintainer changes.
  • The current release (Beta 37 → 41) updated in place and reopened, both as a plain AppImage in ~/Applications and through Gear Lever. [Linux] AppImage opens download link instead of self updating #123 didn't reproduce there; details were asked from the reporter.
  • This PR as first opened, built as Beta 40, updated to Beta 41 and reopened in desktop mode, with no staging folder left. That run found the old runtime staying alive (fixed in e2852ae).
  • With the maintainer changes: a plain AppImage in ~/Applications updated to Beta 41 and reopened in desktop mode, leaving no staging folder or update-pending.json.
  • Big Picture (from the "few updates behind" window, since Big Picture's Downloads page has no launcher row until Big Picture: the launcher's own update gets a row on the Downloads page #139): reopened in Big Picture, and the old runtime and its mount were gone.
  • Gear Lever (started from its menu entry): updated in place under Gear Lever's lowercase name, the menu entry unchanged, the old runtime gone.
  • A read-only folder: "RecompLauncher Can't Update Itself Here" named the folder before any download, Download It opened the AppImage in the browser, and the installed image was untouched.
  • The failure window: with a failed update left in update-pending.json, the next start logged it, counted strike 1 in update-bad.json, showed "The Update Didn't Start", and Try Again updated to Beta 41.
  • Steam Deck Gaming Mode, before release.

New strings for translation: "The Update Didn't Start" (shared with #126), its Linux message, "Try Again" (already exists), "RecompLauncher Can't Update Itself Here", its message, "Download It".

For the website (SDK guide): nothing; this doesn't change recomplauncher.json.

Screenshots

N/A

Checklist

  • One change per pull request
  • No version bump or patch notes (those are done at release time)
  • If it changes what developers can write in recomplauncher.json: the schema and docs are updated too

@innateessence
innateessence force-pushed the feat/linux-appimage-self-update branch from 375851f to 770f5ab Compare November 13, 2026 00:38
@innateessence

innateessence commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor Author

Success, I suck at reviewing rust code but everything looks good to me.

@innateessence
innateessence marked this pull request as ready for review November 13, 2026 00:58
Copilot AI balanced review requested due to automatic review settings November 13, 2026 00:58

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are reported for the Linux AppImage self-update change.

No open issues 🎉

What changed in this PR

Adds in-place Linux AppImage self-updates to address #123, replacing the download-link behavior with a validated update and restart flow.

Changes:

  • Validates Linux update metadata, checksums, download size, and runtime architecture before staging.
  • Replaces the AppImage after the launcher exits, preserves the current display mode, and restores the previous image on immediate launch failure.
  • Adds progress and retry handling, regression tests, and updater documentation.
File Description
ui/​tv.js Prevents controller dismissal of busy update dialogs.
ui/​more.js Keeps Linux update progress open and clears it on failure.
ui/​app.js Guards duplicate updates, preserves display mode, and shows update errors.
tests/​appimage-update.test.cjs Adds UI and shell-helper regression coverage.
src-tauri/​src/​lib.rs Integrates AppImage updates, Linux metadata handling, and restart state.
src-tauri/​src/​appimage.rs Validates AppImage container and native runtime architecture.
src-tauri/​src/​appimage_update.sh Handles replacement, restart, rollback, and staging cleanup.
src-tauri/​src/​appimage_update.rs Implements validated downloads, staging, and helper handoff with tests.
docs/​LAUNCHER-API.md Documents Linux update metadata, behavior, and recovery limits.

Review effort: Balanced

@innateessence

Copy link
Copy Markdown
Contributor Author

@Xarishark You might be interested in this. No rush.

…folder it can't change

- A failed update goes through update-pending.json like the installer and the Mac
  updater: the old version's next start shows The Update Didn't Start with Try Again,
  and the second failure from the same file stops it being offered. The helper's own
  error file is gone; it notes what happened in launcher-trail.log instead.
- When the swap fails, the unchanged launcher opens again instead of leaving no window.
- A folder this account can't change is checked before the download, and a window
  names it and offers the new AppImage to download.
- Staging folders an interrupted update left behind are removed at start once they're
  an hour old.
- One trusted-download check (origin and path) for every platform's update URL; it
  still lets RL_API point at a local copy of the site for testing.
…w launcher

The AppImage runtime passes its mount to every program it starts through descriptor 1023. The update helper inherited it and handed it to the new launcher, so the old runtime kept running until the new launcher closed. The helper now closes it before it starts.
The runtime keeps its FUSE process up until no program holds the read end of a pipe it hands every child, besides its mount at descriptor 1023. Closing 1023 alone left the pipe with the new launcher, so the old runtime still stayed. Everything past stdio is now close-on-exec in the helper (close_range, Linux 5.11+), with a test that an inheritable descriptor doesn't reach it.
@Xarishark

Copy link
Copy Markdown
Collaborator

@innateessence this is now in series to be merged. when the previous PRs in the series get dealt with we will merge this also. Good Job!

@elripalda
elripalda marked this pull request as ready for review November 13, 2026 12:03
# Conflicts:
#	src-tauri/src/lib.rs
#	ui/app.js
#	ui/tv.js
When the swap fails, the helper reopens the unchanged launcher in the background and exits. The test could remove its folder while that launcher was still writing there, and fail with ENOTEMPTY (9 of 40 runs).
@elripalda
elripalda merged commit 705772f into elripalda:main Nov 13, 2026
4 checks passed
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.

4 participants