Repository navigation
Game updates go in whole or leave the game as it was - #303
Merged
Merged
Conversation
swap.rs sets the old release's files aside in the game's folder, moves the new ones in, and puts everything back on any failure. A marker written first lets the next start finish or undo an update the launcher was closed in. Not wired into installs yet.
The release is unpacked beside the game first, then the old files it replaces or drops are set aside and the new ones moved in. A failure, or a later step like the repo clone failing, puts everything back and says what stopped it. The old files go only once the library is saved, and a launcher closed partway finishes or undoes the update at its next start. Scans for the program, setup, backups and saves skip the set-aside folder.
Xarishark
marked this pull request as draft
November 18, 2026 20:45
…date # Conflicts: # src-tauri/src/manage.rs
Xarishark
marked this pull request as ready for review
November 19, 2026 00:18
This was referenced Nov 19, 2026
Xarishark
marked this pull request as draft
November 19, 2026 00:40
Xarishark
marked this pull request as ready for review
November 19, 2026 01:07
Xarishark
added a commit
to Xarishark/RecompLauncher
that referenced
this pull request
Nov 19, 2026
Brings in Beta 65, the game update rollback (elripalda#303), keeps_copy (elripalda#308) and the developer guide additions (elripalda#311). Every language file gained texts on both sides at its end; both are kept. The setup step keeps its temp folder, room check and data folder, and takes main's prepare_args, so a run without the copy (keeps_copy) gets them too. The "no prepare.done" warning stays quiet for a keeps_copy step, which already gets its own more exact one.
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.
Before this change, an update unpacked into staging and then moved its files into the game's folder one at a time, then deleted the files the old release had and the new one doesn't. If something failed partway (a locked file, a full drive, the launcher closing), the game was left with a mix of old and new files and nothing undid it. Games keep more and more builds and caches in their own folder, so a half-applied update is expensive.
What changes
install::stageunpacks the release beside the game's folder (<library>/.staging/<id>, so it's on the same drive). The Flatpak AppImage unpack and Mac zip unwrapping still happen there. A full drive or a bad archive stops the update before the game is touched.swap.rs. It sets aside, in<game>/.recomplauncher-game-update/old, what the new release replaces (Mac.appbundles go whole) and the old release's files it drops. Then it moves the new files in. On one drive both steps are renames. If any step fails, the new files come out and the old ones go back, and the error says which file stopped it and that nothing changed.update.json) is written and synced to disk before anything moves. At startup, and before every install,swap::recoverchecks it. If the saved library already has the new files and SHA-256, the update is finished; otherwise it is undone. Undoing again after an interruption is safe.remove_droppedis nowdropped(it returns the list and deletes nothing).updated_exereturns the old AppImage it replaces instead of deleting it. The old single-file build that used to be deleted before unpacking now goes through the swap too.files); the same for a file where the release has a folder. Otherwise the update stops before anything moves and names the folder or file as holding the player's own files. A link there (a release folder the player moved to another drive) is set aside as a link, as before, and what it points at is never touched.put_in_placetakes the old release's file list for this.manage::game_size; moving the game still counts all of it), the check for the same game already in a new place, the settings files read for the player's copy, the Linux-program check, and the folder listing plugins get. Moving and uninstalling still take the whole folder.install::unpack+overlay.Tests
swap.rs: failure after N moves for every N; launcher closed after N moves for every N, then recovered at start; closed right after writing the marker; closed after the record was saved (the update is finished); closed while undoing; a later step failing; locked file; a tampered marker pointing outside the game folder; dropped files outside the game folder; empty folders left by dropped files; a release file where the game has a folder of only old release files (goes ahead) or one with a player file (stops, nothing changed); the same for a release folder where the game has a file; a release folder where the game has a link to a folder outside it (Unix only: goes in, the link's target untouched); an update still counting after the library is saved and loaded again (nested paths, so Windows separators are covered).install.rs: a staged zip update going in whole and keeping saves; the set-aside folder is never picked as the game's program.manage.rsandlib.rs: a game's size leaves out what an update set aside (and moving still counts it); the same-game check ignores it.cargo test747 passed, 0 failed;node --test tests/*.test.cjs361 passed.cargo testpassed (707), including the locked-file test with a real Windows lock (share_mode(0)) and the save-and-load check.Game.appfolder), the Flatpak itself, and a real end-to-end update in the running app.Patch notes
Player line: Game updates go in whole or not at all: if one is interrupted (a locked file, a full drive, the PC turning off), your game is left exactly as it was.
For the website (SDK guide), optional since no recomplauncher.json field changed: in "Releases that install cleanly", add that updates go in whole or not at all, and that files the last release had and the new one doesn't are taken away unless the game changed them.