Skip to content

Switch between versions of a game: saves, game copy and shortcuts come along - #265

Open
Felitendo wants to merge 3 commits into
elripalda:mainfrom
Felitendo:feat/bring-saves-over
Open

Felitendo wants to merge 3 commits into
elripalda:mainfrom
Felitendo:feat/bring-saves-over

Conversation

@Felitendo

@Felitendo Felitendo commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

What

Installing a second version of a game (another recomp of it) now asks: Switch completely or Keep both.

  • Switch completely: on the new version's first start, once it's installed and set up, the old version's saves are copied over. Its shortcuts in the app menu and on the desktop then move to the new version, and the old one is uninstalled. If its saves can't come along, the old version stays. The "A Better Version Is Out" note goes through the same question.
  • The game copy comes along: the copy of the game (and its update) the other version was set up with is checked against the new version (precheck_copy). If it fits, setup starts with it right after the download, on the desktop and in Big Picture, and "Pick Your Copy First?" isn't asked. The setup of a version installed without a copy offers it first ("Your copy from Hookshot").
  • Bring saves over: with Keep both, a version's first start offers the saves of the one played last, and its Saves tab has Bring Saves Over. What the new version had is backed up first, so Put back undoes it.
  • Uninstalling takes away the launcher's shortcuts for the game. Once its folder is deleted, it also takes away the game's own shortcuts that point into that folder.

Why

Players switch between recomps of the same game (Hookshot → Longshot) and lose their saves on the way. They also keep a broken old version in their Library and app menu, and have to pick their game copy again.

How

  • Save places (saves::carry_pairs): places are matched in the order each version lists them. When the player narrowed one side down to a folder inside a place the developer named, the other side gets the same folder inside its matching place. Hookshot's {local}/hookshot/save goes to Longshot's {local}/longshot/save, not into {local}/longshot next to the builder toolchain. Matching uses the same position, or else the only place starting from the same folder ({local}, {install}…). The new version then keeps to that folder (save_place), so its backups are its saves.
  • What is never copied: a guessed game folder (from: "game"), files onto themselves (both versions sharing a place), names a * pattern wouldn't read, release files and managed key files.
  • Kind of file: when the new version already has saves of its own, the incoming files must share at least one file extension with them (.sav into a folder of .json is refused). Before its first start there's nothing to compare, so the catalog's saves field decides.
  • Commands:
    • saves_carry_from(to) lists what each installed version of the title would bring, or why it can't (empty when it just has no saves yet).
    • saves_carry(from, to) copies under the saves lock, with both versions reserved in STARTING.
    • move_shortcuts(from, to) replaces the launcher's shortcuts for the old version with the new one's.
  • Shortcuts are recognised by what they run, never by their name: --play <id>, or a program inside the game's folder. On Windows only --play shortcuts (.lnk) are recognised so far.
  • The switch is kept in ui.switch_from until the first start, so the old version stays installed until the new one is set up.
  • Changes a Beta 46 rule: betterGo used to only offer the uninstall once the new version was in (and beta46.test.cjs checked that). The player now decides once, while installing, and the old version only goes after its saves came along. The test checks the new rule.
  • Version names: with Show Game Names on, every version was called after the game. The version menu (desktop and Big Picture), Play menu, versions card, better-version note and switch question now use the version's own name (ownName).
  • Versions pill: refreshGame didn't redraw it, so it kept counting a version uninstalled while its sibling's page was open.

No change to recomplauncher.json, so the schema stays as it is. docs/DEVELOPERS.md says how saves helps players who switch. docs/FAQ.md describes the switch.

Tests

  • save-carry.test.cjs (new, 21 tests): the first-start offer, the switch question, finishing the switch (call order, old version kept when saves can't come along, no copy when the catalog says saves don't work), the game copy coming along, version names, the pill redraw.
  • saves.rs: copying and Put back, saves of another kind of file refused, unknown places, a shared place, one file taking the new version's name, names a pattern wouldn't read, a picked folder matched through the named places (also when listed in another order), places that don't line up.
  • shortcuts.rs: a menu entry by id, a longer id being another game, the game's own entry into its folder, a direct entry with the launcher's icon, an unrelated entry left alone, no folder matching everything, Exec quoting, a Windows .lnk by id.
  • node --test tests/*.test.cjs: 318 passed (after merging main)
  • cargo test: 678 passed, 1 ignored. (pads::tests::through_sdl fails on a machine with a real controller plugged in, since it expects only its virtual pad; it passes without one.) The two .desktop tests with Linux paths don't run on Windows.
  • By hand on Linux: installed Longshot next to Hookshot and chose Switch completely. Setup started with Hookshot's .nup. On first start, 14 save files went from ~/.local/share/hookshot/save to ~/.local/share/longshot/save and Hookshot was uninstalled. Longshot then read the saves. Moving shortcuts came after that run, so the old menu entry was moved by hand there; it is covered by the shortcuts.rs tests, not by this manual run.

German translations for the new texts; the other languages come with the release.

…e along

Installing a second version of a game now asks: switch completely, or keep both.

- Switch completely: on the new version's first start (installed and set up), the old
  version's saves are copied over, its shortcuts in the app menu and on the desktop move to
  the new one, and the old one is uninstalled. If its saves can't come along, it stays. The
  better-version note goes through the same question. This replaces the Beta 46 rule that a
  switch only offers the uninstall: the player now says so once, while installing.
- The copy of the game (and its update) the other version was set up with comes along:
  setup starts with it right after the download, on the desktop and in Big Picture, and the
  setup of a version installed without a copy offers it first.
- Bring saves over: a version's first start offers the saves of the one played last, and
  the Saves tab has Bring Saves Over. Save places are matched in order, or through the
  places the developers named when the player narrowed one side down to a folder inside
  them ({local}/hookshot/save goes to {local}/longshot/save; the new version then keeps to
  that folder, not the toolchain beside it). What the new version had is backed up first,
  so Put back undoes it.
- Uninstalling takes away the launcher's shortcuts for the game, and the game's own ones
  into its folder once that's deleted.
- Versions go by their own names (Longshot) with Show Game Names on too: the version menu,
  the Play menu, the versions card, the better-version note and the switch question.
- The versions pill is redrawn with the game page, so it stops counting a version that was
  uninstalled meanwhile.
- German translations for the new texts; the other languages come with the release.

Tested on Linux by switching from Hookshot to Longshot.
Conflicts: the version row keeps main's play time line with the version's own name; startInstall
asks about switching and about a recomp's games; after a download, main's per-game setup
keeps the brought-along update and starts setup with the brought-along copy in both modes;
de.json is main's with this branch's texts.

The two .desktop entry tests use Linux paths, so they don't run on Windows.
When the version the saves go to already has saves of its own and none of the incoming files
shares a file extension with them (.sav coming into a folder of .json), they aren't brought
over: that version most likely can't read them. Before its first start there's nothing to
compare, so the catalog's saves field still decides there. Switching completely keeps the old
version in that case, as for any save that can't come along.
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