Skip to content

A game writes everything to {data}, setup gets a temp folder of its own, and the SDK rules for both - #309

Merged
elripalda merged 18 commits into
elripalda:mainfrom
Xarishark:feat/ecstatic-noyce-9cc067
Nov 20, 2026
Merged

elripalda merged 18 commits into
elripalda:mainfrom
Xarishark:feat/ecstatic-noyce-9cc067

Conversation

@Xarishark

@Xarishark Xarishark commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

Step E of the recomp standards plan: one data folder per game, a temp folder of its own for every setup run, and the SDK rules that go with them. Off main (5715143, everything ahead of it in the release merged in), with D (#310) in: run_prepare refuses an AppImage on Linux first, then makes its room check and temp folder.

What

  1. {data} and RECOMPLAUNCHER_DATA. {data} is {install}/recompdata. Not data (TotK's release ships one), and not userdata: 11 catalog projects already write or ship a top-level userdata folder (six by our own profiles, and RingOut, GR2port, DPRecomp, WWE 2K14 Recomp and Crash 2 Recompiled in their release zips), and no project writes or ships recompdata. It fills in everywhere {install} does, and the game and its setup step get it as RECOMPLAUNCHER_DATA (as Windows names it, Z:\..., through Proton). The launcher makes the folder before either starts, for any game whose developer wrote it a recomplauncher.json, set up by hand too, so where saves go doesn't change with how the game was set up. Save places in it are written as {data}/....
  2. prepare.env. Like start.env: filled-in paths, {input:<id>} too (a value with an input the player didn't give is left out, as in prepare.args). Left out of the serialized profile when empty, so setups fingerprinted before it existed stay set up. The step also gets RECOMPLAUNCHER=1 and RECOMPLAUNCHER_VERSION, like Play.
  3. A temp folder per setup run. TMPDIR, TEMP and TMP point to <game>/.recomplauncher-tmp, made empty for each run (on the game's drive, not a small system drive or a memory /tmp) and taken away however the run ends: success, failure, Stop. It carries a mark file; a folder by that name without it (a release that ships one, or a link) is never emptied, and setup stops and says so. Play keeps the system's temp folder.
  4. Room first. The step starts only with at least 1 GB free on the game's drive.
  5. Windows long paths. When a setup step prints that a path was too long (PathTooLongException, "The filename or extension is too long", os error 206), or an install or move hits error 206, the player is told to use a library folder with a shorter path or to turn on Windows' LongPathsEnabled. The launcher never changes that setting. The message keeps what the step printed last on a line under it, so a step that warned about a path early and stopped later for another reason still shows that reason.
  6. Backups and cloud saves leave out the setup temp folder, the old release an update sets aside (.recomplauncher-game-update, from Game updates go in whole or leave the game as it was #303) and tmp folders, as they already left out cache, even when a save place is all of {data} or the whole game folder.
  7. Uninstall keeps the saves. Deleting the folder used to delete {data}/saves with it. Now a copy of the saves inside the folder is made first, for the game and each of its games with saves of their own, into <library>/.backups/<game>/saves (which uninstalling leaves) or the player's chosen folder. The Saves tab puts it back after a reinstall. If the copy fails, the folder stays and the player is told. Desktop: a tick under the delete one, on by default and greyed out while the folder is kept. Big Picture: "Uninstall and delete its folder" (keeps a copy), "Delete its folder and its saves", "Uninstall, keep its folder".
  8. Developer tools, yellow and never blocking: no prepare.done (only when there's a step and it builds from the player's copy); paths written outside {install} and {data} (saves, settings files, folders, args, env using {home}, {local}, {config}, {documents}, {appdata}); prepare.env names that can't be set. The warning about a separate {game} argument with keeps_copy comes from C (A setup step that keeps the copy builds again without it (prepare.keeps_copy) #308), now merged in; the prepare.done one stays quiet for a keeps_copy step, which C already warns about. When a keeps_copy step runs again without the copy, prepare.env values naming {game} are left out, as its arguments are.
  9. Developer guide. A new "Where your game writes" section, {data} in the paths table, RECOMPLAUNCHER_DATA, prepare.env, the temp folder, room and long-path notes in prepare, and the old "keep the SDK in your builder's own folder" line replaced. Since automatic updates became the player's choice (Settings → Updates: Update All Games Automatically, and a game's own switch opts it out #332), "Never update yourself" says the launcher brings players every release, by itself once they turn automatic updates on. After D: APPIMAGE is never set, and since an update replaces the program's own files (an unpacked AppImage's AppRun and usr/, a .app's contents), the game writes to {data}. Release rules: Linux ships a tarball (.tar.gz, .tar.xz or .tar.zst) and an AppImage of one portable build, both played from a plain folder (GitHub Actions ubuntu:22.04 container or the Steam Runtime sniper SDK), source archives say source, nothing in Program Files without a proper installer/uninstaller (MSIX) or a package manager.

macOS gets only {data} and the setup temp folder. Neither has been tried on a Mac.

Tests

  • cargo test on Linux (Bazzite VM, distrobox): 880 passed, 0 failed (1 ignored, from main), including the schema parity tests, after merging main (5715143). Each commit's tree was tested on its own too.
  • cargo test on Windows 11 (VM): 815 passed, 0 failed (1 ignored). That covers the setup step's real .bat seeing its temp folder, RECOMPLAUNCHER_DATA and prepare.env, and the copy and move into a library folder deeper than 260 characters.
  • node --test: 531 passed on Linux. On Windows 520 passed and 11 were skipped (the tests skip themselves there). New tests/uninstall-keep-saves.test.cjs covers the desktop and Big Picture choices and checks every new text is in every language.
  • tools/launcher-i18n.py: the 9 new texts are in all 21 languages, with matching placeholders.
  • A real run in the launcher (debug build driven by tauri-driver, Linux VM): Set Up on a made-up game whose step logs what it gets. While it ran, Temper/.recomplauncher-tmp held the mark and the 1 MB file the step wrote. TMPDIR, TEMP and TMP all pointed there, RECOMPLAUNCHER=1 was set, RECOMPLAUNCHER_DATA was Temper/userdata (the name before it became recompdata; the run predates the rename) and prepare.env's {data}/cache was filled in. After the run the folder was gone. Play then got no TMPDIR and did get RECOMPLAUNCHER_DATA. Uninstall with the folder deleted kept .backups/Temper/saves/<n>.zip holding only saves/slot1.sav (no build or cache) and removed the folder.
  • Not run: macOS, the Flatpak, Proton (the Z:\ form of RECOMPLAUNCHER_DATA is covered only by the existing wine_path), and a real Windows build failing on a long path (the message is matched from the step's output).

Patch notes (players)

  • Setting a game up uses a temp folder of its own on the game's drive, gone when setup ends, and waits until there's 1 GB free. Uninstalling a game keeps a copy of its saves first, so you can put them back if you install it again.

For the website (SDK guide)

  • Add {data} ({install}/recompdata, also given as RECOMPLAUNCHER_DATA to the game and its setup step) and prepare.env (like start.env). Then add the "Where your game writes" rules: write only under {install}/{data}, take one data path for everything, keep caches in {data}/cache, treat temp as temp (setup gets TMPDIR/TEMP/TMP of its own), don't bootstrap or depend on `` (never set: Linux always plays from a plain folder), write nothing into the program's own files (an update replaces them), and never update yourself when RECOMPLAUNCHER=1.
  • Under releases: Linux ships a tarball (.tar.gz, .tar.xz or .tar.zst) and an AppImage of the same portable build (ubuntu:22.04 container or Steam Runtime sniper), source archives say source, and nothing goes into Program Files without a proper installer/uninstaller or a package manager. Under prepare: a step built from the player's copy keeps what it needs in its folder and lists prepare.done; an options-only run reuses earlier work.
  • Under prepare: the step runs with no window and never asks anything or waits for input, so everything it needs comes from its arguments and environment. Under self-updating games: skip the updater when RECOMPLAUNCHER is set, and if only a flag turns it off, put the flag in start.args ("args": ["--no-update-check"]).

…lder of its own

{data} is userdata inside the game's folder (not data: TotK's release ships one). It fills in like {install} everywhere, and the game and its setup step get it as RECOMPLAUNCHER_DATA (as Windows names it through Proton). The launcher makes it before either starts, for any game whose developer wrote it a recomplauncher.json, set up by hand too. Save places in it are written as {data}/... .

The setup step also gets RECOMPLAUNCHER=1 and its version, as Play gives, and prepare.env for its own variables (with named inputs filled in, like prepare.args). TMPDIR, TEMP and TMP point to <game>/.recomplauncher-tmp, made empty for each run on the game's drive and taken away however the run ends. A folder by that name the launcher didn't make (no mark inside, or a link) is never emptied: setup stops and says so. Play keeps the system's temp folder.

The step starts only with 1 GB free on the game's drive. On Windows, a step that says a path was too long, or an install or move that hits the path limit, says to use a library folder with a shorter path or turn on Windows' long paths setting, which the launcher never changes. Schema, developer guide and every language updated.
…work folders

A save place around them (all of {data}, or the game's whole folder) no longer takes in the setup step's .recomplauncher-tmp, the old release an update sets aside (.recomplauncher-game-update) or tmp folders; cache folders ({data}/cache) were already left out. Tests show it, and that moving a game, by rename or by copy to another drive, carries its {data} caches and saves, into a library folder deeper than Windows' old 260-character limit too.
Deleting a game's folder deleted the saves in it too, {data}/saves included. Now a copy of them is made first, for the game and each of its games with saves of their own, beside the library (<library>/.backups/<game>/saves, which uninstalling leaves) or in the player's chosen folder, and the Saves tab puts it back after a reinstall. If the copy can't be made, the folder stays and the player is told.

On the desktop it's a tick under the folder one, on by default. Big Picture has the same choice as items: delete the folder keeping a copy of the saves, delete the folder and its saves, or keep the folder. Every language updated.
…tside {install} and {data}

Both in yellow, never stopping the game. prepare.done is asked for only when there's a step and it builds from the player's copy (a game copy or named inputs): without it the launcher can't tell the build is there. The other names the saves, settings files, folders, arguments and variables that use {home}, {local}, {config}, {documents} or {appdata}. prepare.env names that can't be set are named too. The warning about a separate {game} argument waits for prepare.keeps_copy, which isn't on main yet.
…e build, source archives say source

Under Releases that install cleanly: on Linux, one folder built portably (a GitHub Actions ubuntu:22.04 container, or the Steam Runtime's sniper SDK), packed both as a .tar.gz and an AppImage; a source archive uploaded by hand says source in its name so it's never taken for the game; and nothing goes into Program Files without a proper installer and uninstaller (MSIX) or a package manager.
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.
… naming it

keeps_copy leaves out every argument with {game} in it when the copy is gone. An
env value naming {game} would otherwise be set to an empty path, so it is left out
the same way. The guide and schema say so beside the rule for arguments.
…es once

The vendor SDK steps said the setup step gets no environment variables. It now gets
RECOMPLAUNCHER_DATA, prepare.env and a temp folder of its own, so the SDK goes in the
temp folder or {data}/cache, and the prepare.options bullet points there instead of
repeating it. Recomp Standards' release naming and "portable when it can be" bullets
now name the tarball and AppImage pair and the one data folder, and point to the
sections that have the details.
A step that printed a path warning once and stopped later for another reason showed
the player only the long-path advice. The message now has the step's last line under
it, and the UI translates a launcher text whose first line it knows while leaving the
program's own words as they were. MAX_PATH no longer counts as the path limit: it's
a constant's name, which a build can print in a warning that stopped nothing.
The copy of the saves is made only when the folder is deleted, so with "Also delete
its folder" unticked the tick did nothing. It now greys out until that box is ticked.
11 catalog projects already write or ship a top-level userdata folder: six by the
launcher's own profiles (on Windows UserData is the same folder), and RingOut, GR2port,
DPRecomp, WWE 2K14 Recomp and Crash 2 Recompiled in their release zips. {data} would
have landed in their own folder. No project writes or ships recompdata. {data} and
RECOMPLAUNCHER_DATA keep their names; no release has made a userdata folder yet, so
nothing moves.
… flag turns off

From a front end's suggestions (elripalda#313). The setup step runs with no window and never
asks anything or waits for input: what it needs comes from its arguments and
environment. This replaces the bare "Don't open a window". A game that updates itself
skips that under RECOMPLAUNCHER, and if only a flag turns it off, the flag goes in
start.args. The "Never update yourself" rule in "Where your game writes" points there
instead of repeating it.
…nly for Mac apps

The "Never update yourself" rule sent every developer to the Mac apps section for
the start.args flag. The flag sentence now sits in the rule itself, and the Mac apps
paragraph keeps only its Sparkle sentence.
@Xarishark
Xarishark marked this pull request as ready for review November 20, 2026 01:45
@elripalda
elripalda merged commit 108a6a8 into elripalda:main Nov 20, 2026
6 checks passed
@Xarishark
Xarishark deleted the feat/ecstatic-noyce-9cc067 branch November 23, 2026 23:56
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.

2 participants