diff --git a/docs/DEVELOPERS.md b/docs/DEVELOPERS.md index 9971679b..7f62eb0f 100644 --- a/docs/DEVELOPERS.md +++ b/docs/DEVELOPERS.md @@ -42,13 +42,19 @@ through us, and every release you publish reaches players the next time the laun `MyRecomp-v1.2.0-Windows-x64.zip`, `MyRecomp-v1.2.0-Linux-x64.AppImage`. The launcher picks the file for the player's PC from those words. Builds for ARM say `arm64`. - **Zips on Windows.** A `.zip` (or `.7z`) of your folder is best. An installer `.exe` works, but - it's the last choice, because it wants to be run as setup. On Linux, an AppImage or a tarball - (`.tar.gz`, `.tar.xz` or `.tar.zst`), for example `MyRecomp-v1.2.0-Linux-x64.tar.xz`. Either way - the game plays from a plain folder (see [AppImages](#appimages)). + it's the last choice, because it wants to be run as setup. Never install into Program Files + without a proper installer and uninstaller (MSIX) or a package manager: the launcher can't + update or remove what lands there. +- **On Linux, a tarball and an AppImage of the same folder.** A `.tar.gz`, `.tar.xz` or `.tar.zst` + (for example `MyRecomp-v1.2.0-Linux-x64.tar.xz`). Build it once, portably, so it runs on older + systems too: in a GitHub Actions `ubuntu:22.04` container, or the Steam Runtime's `sniper` SDK. + Then pack that one folder both ways. Either way the game plays from a plain folder (see + [AppImages](#appimages)), and players who want a single file to keep get the AppImage. - **One folder on top is fine.** A zip with everything inside `MyRecomp-v1.2.0/` is unwrapped, so your program lands in the game's folder either way. - **Keep extras out of the way.** Files with `debug`, `symbols`, `pdb` or `source` in the name, and - `.sha256`, `.sig` and `.asc` files, are never taken for the game. + `.sha256`, `.sig` and `.asc` files, are never taken for the game. So a source archive you upload + yourself says `source` in its name: `MyRecomp-v1.2.0-source.tar.gz`. - **Checked on the way in.** GitHub keeps a SHA-256 of every file you upload, and the launcher checks the download against it before installing. You don't have to do anything. - **Updates keep what the game made.** An update unpacks over the game's folder, so saves, @@ -67,6 +73,45 @@ through us, and every release you publish reaches players the next time the laun your latest full release, and we can open the pre-release as a beta in the launcher, where players join it with one button and go back just as easily. See [Betas](#betas). +## Where your game writes + +The launcher moves, backs up and uninstalls a game as its folder. What your game writes inside it +goes along; what it writes anywhere else is left behind. So: + +- **Write only under `{install}` and `{data}`.** `{data}` is `recompdata` inside the game's folder, + the one place for everything your game makes: saves, settings, caches, builds. The launcher + makes it before your game or your setup step starts, and passes it as `RECOMPLAUNCHER_DATA`. + Don't ship a `recompdata` folder in your release. +- **Take one data path for everything, like portable emulators do.** A command-line option or + `RECOMPLAUNCHER_DATA` that moves all of it at once, not one option per kind of file. Without one, + keep your system's usual places. An AppImage or a `.app` writes to the system's usual places + (`~/.local/share`, `~/Library/Application Support`) unless it's given a data path; given one, + it's portable and the launcher looks after it. Your program's own files (an unpacked + AppImage's `AppRun` and `usr/`, a `.app`'s contents) are replaced on every update, so nothing + your game writes goes there: it goes in `{data}`. +- **Caches go in `{data}`, under `{data}/cache`.** Backups and cloud saves leave `cache` folders + out, so a shader cache never fills a player's save copies. +- **Temp is temp.** Your setup step gets a temp folder of its own (see [`prepare`](#prepare-your-own-setup-step)), + emptied after every run. Nothing you need later goes there. +- **Name both programs.** `start.program` and `prepare.program` say which file runs. Don't copy + yourself somewhere else and run from there (bootstrapping): the launcher updates the copy in the + game's folder, so the other one goes stale. +- **Don't depend on `$APPIMAGE`.** On Linux the launcher always unpacks your AppImage and runs it + from a plain folder, so `APPIMAGE` is never set (see [AppImages](#appimages)). +- **Never update yourself when `RECOMPLAUNCHER=1`.** Your game and your setup step both get it, + and the launcher brings players every release you publish, by itself once they turn on + automatic updates. If only a flag turns your updater off, put it in `start.args`, like + `"args": ["--no-update-check"]`. + +```json +"start": { "program": ["MyRecomp.exe"], "args": ["--data", "{data}"] }, +"prepare": { "program": ["MyRecomp.exe"], "args": ["--prepare", "--game", "{game}", "--data", "{data}"], "done": ["{data}/build/game.pak"] }, +"saves": ["{data}/saves"] +``` + +Only `{data}` and the setup step's temp folder reach the Mac version of the launcher; neither has +been tried on a Mac yet. + ## Where the file goes The launcher uses the first one it finds: @@ -157,8 +202,8 @@ The first entry that exists on the player's system runs, so one file covers a Ma RecompLauncher 0.90 Beta 54 and older find an app in `start.program` and `prepare.program` only by its program's own path, which works everywhere: `"MyGame.app/Contents/MacOS/MyGame"`. -If your app updates itself (Sparkle, say), leave that off when `RECOMPLAUNCHER` is set: the -launcher installs each of your releases over the app, and two updaters on one app fight. +If your game updates itself (Sparkle, say), skip that when `RECOMPLAUNCHER` is set: the +launcher installs your releases over the app, and two updaters on one app fight. Two examples are worth reading: @@ -280,6 +325,10 @@ Every game the launcher starts also gets these, whether it has a `recomplauncher Use them to fit in: skip your own launcher window, open full screen with your controller menus when the mode is `bigpicture`, and show the right button glyphs from the first frame. +A game with a `recomplauncher.json` also gets `RECOMPLAUNCHER_DATA`: its `{data}` folder, made +before it starts (see [Where your game writes](#where-your-game-writes)). Through Proton on Linux +it's given as Windows names it (`Z:\...`). + ### Paths These fill in anywhere a path, an argument or a value is written: @@ -287,6 +336,7 @@ These fill in anywhere a path, an argument or a value is written: | | | | --- | --- | | `{install}` | Your game's folder | +| `{data}` | `{install}/recompdata`: everything your game writes (see [Where your game writes](#where-your-game-writes)) | | `{game}` | The player's copy (the .iso or the folder; for a .cue, its .bin unless `label` names .cue) | | `{documents}` | Documents | | `{local}` | AppData\Local, or ~/.local/share | @@ -314,6 +364,11 @@ PC. List folders, single files, or files matching a `*` pattern: "saves": ["{local}/My Game/saves", "{install}/settings.toml"] ``` +A game that keeps everything in `{data}` lists `{data}/saves`. Its `{data}/cache`, and the +launcher's own work folders, are never copied, even when you list the whole of `{data}`. When a +player uninstalls the game, a copy of its saves inside its folder is made first, unless they ask +for the saves to go too, and its Saves tab puts it back after a reinstall. + Without it (and without a catalog entry that says), the launcher doesn't guess: the game's Saves tab says it doesn't know where the game saves, and nothing is backed up or synced until the player picks the folder. So say where. Only list saves and small settings: game files, programs and archives are @@ -591,11 +646,36 @@ disc or building a cache, give the launcher a way to run it without a window: It runs on the setup screen as "Getting the extras", after the copy is checked and before the settings are written. It runs again whenever the player changes their copy. -- Don't open a window. +- The step runs with no window and never asks anything or waits for input: everything it needs + comes from its arguments and environment. - Print lines like `progress 0.4 Unpacking menu art` as you go. The number is from 0 to 1 and the text after it shows under the step. - Exit with 0 when it worked. Anything else shows as a failed setup, with your exit code. -- Write what you make to the same place your launcher would, so both stay in step. +- Write what you make to `{data}` (pass it in `args`, or read `RECOMPLAUNCHER_DATA`), and have your + own launcher use the same place when it's given that path, so both stay in step. +- It gets `RECOMPLAUNCHER=1`, `RECOMPLAUNCHER_VERSION` and `RECOMPLAUNCHER_DATA`, like the game. + `env` adds your own, like `start.env`: + + ```json + "prepare": { + "program": ["MyRecompBuilder.exe"], + "args": ["--prepare", "--game", "{game}"], + "env": { "MYRECOMP_CACHE": "{data}/cache" } + } + ``` +- `TMPDIR`, `TEMP` and `TMP` point to `{install}/.recomplauncher-tmp`, a folder the launcher makes + empty for each run, on the game's drive, and takes away when the step ends, however it ends. Put + only scratch files there. The game itself, when Play starts it, gets the system's own temp folder. +- The step starts only with at least 1 GB free on the game's drive; otherwise the player is asked + to free some up first. +- On Windows, if what you print says a path was too long (a `PathTooLongException`, "The filename + or extension is too long"), the player is told to use a library folder with a shorter path or to + turn on Windows' long paths setting. The launcher never changes that setting. +- A run for new options only (the player turned one on after setting up) should reuse what the + last run made, not start again from the disc. +- **Built from the player's copy?** Keep everything the game needs in your folder, so it plays + without the copy, and list what the build leaves in `done`. To build again later without the + copy, see `keeps_copy` below. - `"version"` (optional): change it only when players who already set up must run the step again, like when your output format changes. Nothing else in this file makes them set up again. Their next Play opens Easy Setup with a note that the game is built again, whether it's set up from @@ -618,7 +698,7 @@ settings are written. It runs again whenever the player changes their copy. from what the first build unpacked. Then a player who deleted their copy to save space isn't asked for it again: when `version` changes, or a file of `done` is missing, Play builds the game again from what you kept, and Easy Setup runs the step the same way when no copy is picked. The - launcher leaves out every argument with `{game}` in it, so write the copy as one argument + launcher leaves out every argument (and `prepare.env` value) with `{game}` in it, so write the copy as one argument (`--game={game}`, not `"--game", "{game}"`); option args (`--fetch-ngx-sdk`) are still added. List `done` too, so the launcher can tell when the build is finished. When your build folder is gone, or the run fails, the player is asked for their copy and the game is built from that. @@ -699,8 +779,8 @@ when it's on its `args` are added after the step's own: } ] ``` -- Your builder gets only these args. The launcher sets no environment variables for it, so keep - the SDK in your builder's own folder and put runtime files where the game looks. +- Your builder gets these args added to its own, with the step's usual environment. Where to put + the SDK and its runtime files: [Vendor SDKs the build needs](#vendor-sdks-the-build-needs). - Print `progress` lines for the download too. If it fails, exit with a code other than 0: the player sees "Its setup step stopped with code N", so put the reason in your own log. - An option you add in a later release reaches players who already set the game up: Set Up @@ -718,10 +798,11 @@ the player agrees to the vendor's license: the license was accepted. Without the second, it downloads nothing and stops. 2. Add a `prepare.options` tick, as above, with both flags in `args`, a `license`, and `gpu` (`nvidia` for DLSS). Ticking it is the player accepting the license. -3. Keep the SDK in a folder of your builder's own. The launcher sets no environment variables for - `prepare`, so the flags must work without any: a variable you read today can still override the - folder, but it can't be required. Check it by running the builder exactly as the launcher does: - the arguments above, nothing else set. +3. Download the SDK to the step's temp folder (`TEMP`, `TMP`, `TMPDIR`), which is emptied after + every run, or to `{data}/cache` to reuse it on the next one. The step gets + `RECOMPLAUNCHER_DATA` and whatever you set in `prepare.env`, and nothing else of yours: a + variable from your own setup can't be required. Check it by running the builder exactly as the + launcher does, with the arguments above and that environment. 4. Put the vendor's runtime files where the game looks for them, never in your release. For DLSS, that is `nvngx_dlss.dll`, and `nvngx_dlssg.dll` for frame generation, in an `ngx` folder in the game's folder. @@ -880,13 +961,13 @@ CHD is the format most disc-based backups come in, and the one players ask for m ### Releases - **Tag every release with a version** (`v1.2.0`) and attach the builds to the GitHub release, not just to the README or Actions. -- **One file per platform, with a name that says what it is**, the same way every time: `yourgame-1.2.0-windows-x64.zip`, `-linux-x86_64.AppImage`, `-macos-arm64.zip`. +- **Name every file for what it is**, the same way every time: `yourgame-1.2.0-windows-x64.zip`, `-linux-x86_64.tar.gz` and `-linux-x86_64.AppImage`, `-macos-arm64.zip`. [Releases that install cleanly](#releases-that-install-cleanly) has the rest: the words a launcher picks a file by, one portable Linux build packed both ways, `source` in a source archive's name, and staying out of Program Files. - **Build for Linux and Mac too** when you can. A lot of players are on Steam Deck. - **Say what changed** in the release notes, even in one line. ### On the player's PC -- **Portable when it can be.** If the folder next to the exe is writable, keep saves, settings and logs there. Otherwise use the usual per-user folder, and say where in the README. +- **One data folder, and a way to move it.** Take one option for where everything goes (saves, settings, caches, logs), like portable emulators do. Without it, use the system's usual per-user folder, and say where in the README. A launcher can then keep all of it with the game: RecompLauncher passes `{data}` (`RECOMPLAUNCHER_DATA`), see [Where your game writes](#where-your-game-writes). - **Settings in a file a person can read**: TOML, INI or JSON, with every option written out and commented. Don't hide settings in the registry. - **Logs in a known place**, kept for the last few runs, so players can send them when something breaks. - **Controllers through SDL**, with buttons that can be remapped and a sensible default for Xbox, PlayStation and Switch pads. @@ -919,6 +1000,8 @@ The launcher has tools for this. In Settings, open Developers and turn on Develo and the choice each setting shows right now. Problems are marked in red, things worth a look in yellow. JSON mistakes show the line and column. It also sums up how the game is set up (launches with the player's copy, or needs a one-time step) and what it can do. + It also flags, in yellow, a step that builds from the player's copy without `prepare.done`, and + paths your game writes to outside `{install}` and `{data}`. Those never stop your game. No file yet? "Make a starter file" writes one next to your program to begin from. 3. **Try it like a player.** Set it up with your own disc, change a setting, then open your settings file: only the keys you listed should have changed. Press Play: your game should start diff --git a/docs/recomplauncher.schema.json b/docs/recomplauncher.schema.json index c7d03150..2a990890 100644 --- a/docs/recomplauncher.schema.json +++ b/docs/recomplauncher.schema.json @@ -334,7 +334,7 @@ }, "env": { "type": "object", - "description": "Environment variables for your game, like SDL hints. Paths such as {install} fill in. RECOMPLAUNCHER_ names and system ones like PATH are left out.", + "description": "Environment variables for your game, like SDL hints. Paths such as {install} and {data} fill in. RECOMPLAUNCHER_ names and system ones like PATH are left out.", "propertyNames": { "pattern": "^[A-Za-z_][A-Za-z0-9_]{0,63}$" }, @@ -371,12 +371,22 @@ "done": { "type": "array", "items": { "type": "string" }, - "description": "Files the step leaves when it has finished ({home}, {local}, {install}...). All there: the game counts as set up and plays without the copy unless start uses {game}. The ones in the build folder are also what a player's own build must have for the launcher to use it." + "description": "Files the step leaves when it has finished ({data}, {install}, {home}...). All there: the game counts as set up and plays without the copy unless start uses {game}. The ones in the build folder are also what a player's own build must have for the launcher to use it." + }, + "env": { + "type": "object", + "description": "Environment variables for the step, like start.env. Paths such as {data} and {input:} fill in. RECOMPLAUNCHER_ names and system ones like PATH, TEMP and TMP are left out: the step gets a temp folder of its own.", + "propertyNames": { + "pattern": "^[A-Za-z_][A-Za-z0-9_]{0,63}$" + }, + "additionalProperties": { + "type": "string" + } }, "keeps_copy": { "type": "boolean", "default": false, - "description": "Your step keeps what it needs from the copy in your build folder (the first folders.game) and can run again from there without it. With the copy gone, the launcher runs it again leaving out every argument with {game} in it, so write the copy as one argument (--game={game}). List done too." + "description": "Your step keeps what it needs from the copy in your build folder (the first folders.game) and can run again from there without it. With the copy gone, the launcher runs it again leaving out every argument (and prepare.env value) with {game} in it, so write the copy as one argument (--game={game}). List done too." }, "version": { "type": "string", diff --git a/src-tauri/src/devtools.rs b/src-tauri/src/devtools.rs index a06a61d9..0a64c41f 100644 --- a/src-tauri/src/devtools.rs +++ b/src-tauri/src/devtools.rs @@ -530,11 +530,60 @@ fn check_profile(p: &profile::Profile, dir: &Path, g: &Installed, items: &mut Ve } items.extend(option_items(&pr.options)); items.extend(version_item(&pr.version)); + items.extend(done_item(p)); + let bad: Vec<&str> = pr.env.keys().filter(|k| !profile::env_name_ok(k)).map(String::as_str).collect(); + if !bad.is_empty() { + items.push(warn(format!("Left out of \"prepare.env\": {}", bad.join(", ")), + "Names are letters, digits and _. The launcher's own RECOMPLAUNCHER_ ones and system ones like PATH and TEMP can't be set: the step gets a temp folder of its own.")); + } items.extend(keeps_copy_items(p, dir)); } + items.extend(outside_item(p)); level } +/// A step that builds the game from the player's copy, without `prepare.done`: the launcher can't +/// tell the build is there, so it can't keep the game set up after an update, or use a build the +/// player already has. Only then: a step that only fetches extras needs no list. A keeps_copy +/// step gets its own, more exact warning from keeps_copy_items. +fn done_item(p: &profile::Profile) -> Option { + let pr = p.prepare.as_ref()?; + let from_copy = p.game.is_some() || !p.inputs.is_empty(); + if !from_copy || !pr.done.is_empty() || pr.keeps_copy { + return None; + } + Some(warn( + "No \"prepare.done\"", + "List a file your step always leaves, like \"{data}/build/game.pak\": the launcher then knows the game is built, keeps it set up after an update, and can use a build the player already has.", + )) +} + +/// The places outside the game's folder a profile has the game write to (saves, settings, builds, +/// the folders it passes). Not wrong, but everything in `{install}` or `{data}` moves, backs up and +/// uninstalls with the game, and nothing is left behind. +fn outside_item(p: &profile::Profile) -> Option { + const OUTSIDE: [&str; 5] = ["{home}", "{local}", "{config}", "{documents}", "{appdata}"]; + let mut written: Vec<&str> = p.saves.iter().map(String::as_str).collect(); + written.extend(p.config.iter().flat_map(|c| c.file.iter().map(|f| f.path.as_str()))); + written.extend(p.folders.values().flatten().map(|f| f.path.as_str())); + if let Some(s) = p.start.as_ref() { + written.extend(s.args.iter().chain(s.env.values()).map(String::as_str)); + } + if let Some(pr) = p.prepare.as_ref() { + written.extend(pr.args.iter().chain(pr.env.values()).chain(pr.done.iter()).map(String::as_str)); + } + let mut outside: Vec<&str> = written.into_iter().filter(|w| OUTSIDE.iter().any(|o| w.contains(o))).collect(); + outside.sort(); + outside.dedup(); + if outside.is_empty() { + return None; + } + Some(warn( + format!("Writes outside {{install}} and {{data}}: {}", outside.join(", ")), + "Keep saves, settings, caches and builds in {data} (or {install}): they then move, back up and uninstall with the game. Players' saves already elsewhere are fine to keep reading.", + )) +} + /// prepare.keeps_copy: run again without the copy, leaving out the arguments with {game} in them. /// Only what would make that run go wrong, or never happen, is said; nothing stops the game. fn keeps_copy_items(p: &profile::Profile, dir: &Path) -> Vec { @@ -687,6 +736,44 @@ mod tests { assert!(items[0].text.contains("starts off") && items[0].text.contains("required"), "{}", items[0].text); } + fn profile(json: &str) -> crate::profile::Profile { + serde_json::from_str(json).unwrap() + } + + #[test] + fn a_step_building_from_the_copy_without_done_is_warned() { + let p = profile(r#"{"format":1,"game":{"kind":"iso"},"prepare":{"program":["Builder.exe"],"args":["{game}"]}}"#); + let item = super::done_item(&p).unwrap(); + assert_eq!(item.level, "warn"); + assert!(item.text.contains("prepare.done"), "{}", item.text); + } + + #[test] + fn a_step_with_done_or_without_a_copy_is_left_alone() { + let with_done = profile(r#"{"format":1,"game":{"kind":"iso"},"prepare":{"program":["Builder.exe"],"done":["{data}/build/game.pak"]}}"#); + assert!(super::done_item(&with_done).is_none()); + let extras_only = profile(r#"{"format":1,"prepare":{"program":["Fetcher.exe"]}}"#); + assert!(super::done_item(&extras_only).is_none()); + let no_step = profile(r#"{"format":1,"game":{"kind":"iso"}}"#); + assert!(super::done_item(&no_step).is_none()); + } + + #[test] + fn writing_outside_the_game_folder_is_named() { + let p = profile(r#"{"format":1,"saves":["{local}/Game/saves","{data}/saves"], + "prepare":{"program":["Builder.exe"],"args":["--out","{home}/Games/Game"],"env":{"CACHE":"{data}/cache"}}}"#); + let item = super::outside_item(&p).unwrap(); + assert_eq!(item.level, "warn"); + assert!(item.text.contains("{local}/Game/saves") && item.text.contains("{home}/Games/Game"), "{}", item.text); + assert!(!item.text.contains("{data}/"), "{}", item.text); + } + + #[test] + fn writing_only_in_install_and_data_is_fine() { + let p = profile(r#"{"format":1,"saves":["{data}/saves","{install}/settings.toml"],"start":{"program":["g.exe"],"args":["--data","{data}"]}}"#); + assert!(super::outside_item(&p).is_none()); + } + #[test] fn the_setup_steps_version_is_named_in_the_check() { assert!(super::version_item("").is_none()); diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 250f3c1b..dc24196d 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -59,6 +59,7 @@ pub mod sysenv; mod emus; pub mod roms; pub mod saves; +pub mod setup_temp; pub mod shortcuts; pub mod steam_sync; pub mod swap; @@ -1133,7 +1134,10 @@ async fn install(app: AppHandle, st: State<'_, App>, id: String, dir: Option, id: String, delete_files: bool, run_uninstaller: Option) -> Res { +fn uninstall(st: State<'_, App>, id: String, delete_files: bool, run_uninstaller: Option, keep_saves: Option) -> Res { if st.running.lock().unwrap().contains_key(&id) { return Err(Error::Msg("Close the game first.".into())); } @@ -1268,6 +1272,8 @@ fn uninstall(st: State<'_, App>, id: String, delete_files: bool, run_uninstaller let mut uninstaller = false; let mut kept_copy: Option = None; let mut copy_stuck = false; + let mut saves_kept = false; + let mut saves_stuck = false; if delete_files { // A Flatpak the launcher installed from the game's bundle goes with it. if !cfg!(windows) && flatpak::available() { @@ -1286,7 +1292,20 @@ fn uninstall(st: State<'_, App>, id: String, delete_files: bool, run_uninstaller // folder are theirs: moved out to "Game Copies" beside it first, and if one can't be, the // folder stays. Only files: a folder there is the launcher's unpack of their disc. let mut keep_failed = false; - if ok { + // Its saves inside the folder ({data}/saves, say): a copy beside the library first, which + // uninstalling leaves and the Saves tab puts back after a reinstall. Asked for unless the + // player said not to; if it can't be made, the folder stays. + if ok && keep_saves != Some(false) { + match keep_saves_inside(&st, &g) { + Ok(n) => saves_kept = n > 0, + Err(e) => { + trail::note(format!("Uninstall {id}: its saves couldn't be copied first ({e}), the folder stays")); + keep_failed = true; + saves_stuck = true; + } + } + } + if ok && !keep_failed { for c in [g.game_copy.as_ref(), g.update_copy.as_ref()].into_iter().flatten() { if !(library::inside(c, &g.path) && c.is_file() && !c.is_symlink()) { continue; @@ -1303,7 +1322,7 @@ fn uninstall(st: State<'_, App>, id: String, delete_files: bool, run_uninstaller if ok && !keep_failed { left = remove_game_folder(&g.path); } else if g.path.is_dir() { - copy_stuck = keep_failed; + copy_stuck = keep_failed && !saves_stuck; kept = true; } // A game its own installer put somewhere else (Program Files): its own uninstaller, the @@ -1316,7 +1335,32 @@ fn uninstall(st: State<'_, App>, id: String, delete_files: bool, run_uninstaller } st.lib.lock().unwrap().forget(&id); st.save(); - Ok(json!({"left": left.len(), "path": g.path, "kept": kept, "uninstaller": uninstaller, "kept_copy": kept_copy, "copy_stuck": copy_stuck})) + Ok(json!({"left": left.len(), "path": g.path, "kept": kept, "uninstaller": uninstaller, "kept_copy": kept_copy, "copy_stuck": copy_stuck, "saves_kept": saves_kept, "saves_stuck": saves_stuck})) +} + +/// A copy of the saves a game keeps inside its own folder, for it and each of its games with saves +/// of their own, made before the folder is deleted. Copies go beside the library (or to the +/// player's chosen folder), never inside the game's folder. How many games had saves to keep. +fn keep_saves_inside(st: &App, g: &Installed) -> Result { + let mut ids = vec![g.id.clone()]; + for game in games_of(st, &g.id, g).iter().filter(|x| !x.saves.is_empty()) { + ids.push(games::full(&g.id, &game.id)); + } + let mut kept = 0; + for id in ids { + let spots = cloud::spots_of(st, &id, g); + if saves::files_inside(&spots, g).is_empty() { + continue; + } + let copies = saves::dir_of(&st.dir, &id, g); + if library::inside(&copies, &g.path) { + return Err(Error::Msg("its copies would be inside the folder being deleted".into())); + } + // None: nothing changed since the newest copy, which already holds them. + saves::backup(&st.dir, &id, &spots, g)?; + kept += 1; + } + Ok(kept) } /// Move the player's copy out of a game folder that's about to go, to "Game Copies/" beside @@ -1510,8 +1554,11 @@ async fn move_game(app: AppHandle, st: State<'_, App>, id: String, to: String, u .await .map_err(|e| Error::Msg(e.to_string()))?; st.moving.lock().unwrap().remove(&id); - r?; - // Its backups go with it. + r.map_err(|e| match e { + Error::Io(io) if setup_temp::io_too_long(&io) => Error::Msg(setup_temp::TOO_LONG.into()), + e => e, + })?; + // Its backups go with it (its {data}, caches and all, is inside its folder and went too). let old_b = backups_dir(&g); let mut out = g.clone(); out.path = dest; @@ -3151,6 +3198,15 @@ fn start_game_with_monitor_context( .env("RECOMPLAUNCHER_VERSION", env!("CARGO_PKG_VERSION")) .env("RECOMPLAUNCHER_MODE", if BIG_PICTURE.load(Ordering::Relaxed) { "bigpicture" } else { "desktop" }) .env("RECOMPLAUNCHER_PAD", profile::pad_now()); + // The one folder a game writes everything to ({data}), for a game whose developer wrote it a + // recomplauncher.json. Set up by hand too: where its saves go mustn't change with how it was + // set up. + if let Some(data) = profile_of(&st, id, &g).filter(|p| !p.from_boot).map(|_| profile::data_dir(&g.path)) { + let _ = std::fs::create_dir_all(&data); + let shown = data.to_string_lossy().to_string(); + let through_proton = !cfg!(windows) && matches!(ext.as_str(), "exe" | "cmd" | "bat"); + cmd.env("RECOMPLAUNCHER_DATA", if through_proton { profile::wine_path(&shown) } else { shown }); + } // A Python set up elsewhere on the PC (PYTHONHOME, PYTHONPATH) breaks the Python some games // carry inside them ("No module named 'encodings'"). Games with their own Python never want them. if ext != "py" { @@ -4140,9 +4196,26 @@ fn run_prepare(pr: &profile::Prepare, install: &Path, copy: Option<&Path>, extra if cfg!(target_os = "linux") && exe.extension().is_some_and(|x| x.eq_ignore_ascii_case("appimage")) { return Err(APPIMAGE_NOT_RUN.into()); } + if !setup_temp::room_for_setup(manage::free_space(install)) { + return Err(setup_temp::NO_ROOM.into()); + } + // A temp folder of its own on the game's drive, taken away however this returns. + let temp = setup_temp::SetupTemp::make(install)?; + let data = profile::data_dir(install); + let _ = std::fs::create_dir_all(&data); let args = prepare_args(pr, install, copy, extra); let mut c = std::process::Command::new(&exe); sysenv::clean_std(&mut c); + // As for Play: the step can tell it was started from here (so it never updates itself), and + // where to write. + c.env("RECOMPLAUNCHER", "1").env("RECOMPLAUNCHER_VERSION", env!("CARGO_PKG_VERSION")).env("RECOMPLAUNCHER_DATA", &data); + for (k, v) in pr.env_vars(install, copy) { + c.env(k, v); + } + // After the step's own: the temp folder is the launcher's to give. + for (k, v) in temp.env() { + c.env(k, v); + } // An unpacked AppImage's AppRun, run for its setup step: what its runtime would have set. if exe.file_name().map(|n| n == "AppRun").unwrap_or(false) { if let Some(dir) = exe.parent() { @@ -4182,7 +4255,10 @@ fn run_prepare(pr: &profile::Prepare, install: &Path, copy: Option<&Path>, extra drop(tx); // What it said last (not a progress line): when it stops on an error, that's usually why. let mut said = String::new(); - let read = |said: &mut String| { + // Whether it said Windows' path limit stopped it, on any line: the reason is usually followed + // by a stack trace. + let mut too_long = false; + let read = |said: &mut String, too_long: &mut bool| { while let Ok(l) = rx.try_recv() { let mut w = l.splitn(3, ' '); if w.next() == Some("progress") { @@ -4190,21 +4266,25 @@ fn run_prepare(pr: &profile::Prepare, install: &Path, copy: Option<&Path>, extra report(pct, w.next().unwrap_or("").trim().to_string()); } else if !l.trim().is_empty() { *said = l.trim().chars().take(300).collect(); + *too_long |= setup_temp::says_too_long(&l); } } }; let start = Instant::now(); loop { - read(&mut said); + read(&mut said, &mut too_long); if let Ok(Some(s)) = child.try_wait() { if s.success() { return Ok(()); } // The last of what it printed, which can arrive just after it closed. std::thread::sleep(std::time::Duration::from_millis(150)); - read(&mut said); + read(&mut said, &mut too_long); let code = s.code().map(|c| c.to_string()).unwrap_or_else(|| "a signal".into()); trail::note(format!("Setup step stopped with code {code}; it said last: {said}")); + if cfg!(windows) && too_long { + return Err(setup_temp::too_long_with(&said)); + } return Err(if said.is_empty() { format!("Its setup step stopped with code {code}.") } else { format!("Its setup step stopped with code {code}: {said}") }); } if stopped() || start.elapsed().as_secs() > pr.timeout { @@ -5513,10 +5593,7 @@ fn setup_inputs_run(app: AppHandle, st: State<'_, App>, id: String) -> Res<()> { placed?; emit("verify", 1.0, "Files selected.".into()); if let Some(pr) = &p.prepare { - let mut pr = pr.clone(); - // Omit an argument containing an absent optional/conditional token. Put flags in - // the same argument (e.g. --dlc={input:dlc}) so a flag cannot steal the next value. - pr.args = inputs::arguments(&pr.args, &p.input_paths, false); + let pr = pr.with_inputs(&p.input_paths); let copy = g.game_copy.as_deref().unwrap_or(&g.path); let copy = p.handed(Some(copy)).unwrap_or_else(|| copy.to_path_buf()); let extra = prepare_extra(&dir, &pr, &g.prepare_opts); @@ -10985,6 +11062,7 @@ mod tests { options: vec![], version: String::new(), done: vec![], + env: BTreeMap::new(), keeps_copy: false, }; @@ -11006,6 +11084,7 @@ mod tests { ); assert_eq!(res.unwrap_err(), "Stopped."); + assert!(!dir.join(setup_temp::FOLDER).exists(), "a stopped step's temp folder goes too"); // The process was stopped immediately, but the external file it wrote remains: assert!(generated_file.exists(), "File generated by external tool before cancellation was preserved"); let content = std::fs::read_to_string(&generated_file).unwrap(); @@ -11015,6 +11094,70 @@ mod tests { } } +#[cfg(test)] +mod prepare_env_tests { + use super::*; + + /// A setup step that writes down what it was given: its temp folder (and whether it was + /// there), the launcher's names and one of its own from prepare.env. + fn tattler(dir: &Path) -> profile::Prepare { + #[cfg(windows)] + // The redirection first: `echo 1>rl.txt` would be read as sending handle 1 to the file. + let (name, script) = ("tattle.bat", "@echo off\r\n>temp.txt echo %TEMP%\r\n>tmp.txt echo %TMP%\r\nif exist \"%TEMP%\" >exists.txt echo yes\r\n>rl.txt echo %RECOMPLAUNCHER%\r\n>data.txt echo %RECOMPLAUNCHER_DATA%\r\n>cache.txt echo %BUILD_CACHE%\r\n"); + #[cfg(not(windows))] + let (name, script) = ("tattle.sh", "#!/bin/sh\necho \"$TMPDIR\" > temp.txt\necho \"$TMP\" > tmp.txt\ntest -d \"$TMPDIR\" && echo yes > exists.txt\necho \"$RECOMPLAUNCHER\" > rl.txt\necho \"$RECOMPLAUNCHER_DATA\" > data.txt\necho \"$BUILD_CACHE\" > cache.txt\n"); + std::fs::write(dir.join(name), script).unwrap(); + #[cfg(unix)] + { + use std::os::unix::fs::PermissionsExt; + std::fs::set_permissions(dir.join(name), std::fs::Permissions::from_mode(0o755)).unwrap(); + } + profile::Prepare { + program: vec![name.into()], + timeout: 60, + env: BTreeMap::from([("BUILD_CACHE".to_string(), "{data}/cache".to_string()), ("TEMP".to_string(), "not-this".to_string())]), + ..Default::default() + } + } + + fn said(dir: &Path, file: &str) -> PathBuf { + PathBuf::from(std::fs::read_to_string(dir.join(file)).unwrap().trim()) + } + + #[test] + fn a_setup_step_gets_its_own_temp_folder_and_the_data_folder() { + let dir = std::env::temp_dir().join(format!("rl-prep-env-{}", std::process::id())); + let _ = std::fs::remove_dir_all(&dir); + std::fs::create_dir_all(&dir).unwrap(); + let pr = tattler(&dir); + run_prepare(&pr, &dir, Some(&dir), &[], &|_, _| {}, &|| false).unwrap(); + let temp = dir.join(setup_temp::FOLDER); + assert_eq!(said(&dir, "temp.txt"), temp); + assert_eq!(said(&dir, "tmp.txt"), temp); + assert_eq!(said(&dir, "exists.txt"), PathBuf::from("yes")); + assert!(!temp.exists(), "the temp folder is gone after the run"); + assert_eq!(said(&dir, "rl.txt"), PathBuf::from("1")); + assert_eq!(said(&dir, "data.txt"), dir.join("recompdata")); + assert!(dir.join("recompdata").is_dir()); + assert_eq!(said(&dir, "cache.txt"), dir.join("recompdata").join("cache")); + let _ = std::fs::remove_dir_all(&dir); + } + + #[test] + fn a_temp_folder_the_launcher_didnt_make_stops_setup_untouched() { + let dir = std::env::temp_dir().join(format!("rl-prep-theirs-{}", std::process::id())); + let _ = std::fs::remove_dir_all(&dir); + std::fs::create_dir_all(dir.join(setup_temp::FOLDER)).unwrap(); + std::fs::write(dir.join(setup_temp::FOLDER).join("release.txt"), b"theirs").unwrap(); + let pr = tattler(&dir); + let e = run_prepare(&pr, &dir, Some(&dir), &[], &|_, _| {}, &|| false).unwrap_err(); + assert_eq!(e, setup_temp::NOT_OURS); + assert!(!dir.join("temp.txt").exists(), "the step didn't run"); + assert!(dir.join(setup_temp::FOLDER).join("release.txt").is_file()); + let _ = std::fs::remove_dir_all(&dir); + } +} + #[cfg(test)] mod fingerprint_tests { use super::*; diff --git a/src-tauri/src/manage.rs b/src-tauri/src/manage.rs index 064071fc..ffe483e7 100644 --- a/src-tauri/src/manage.rs +++ b/src-tauri/src/manage.rs @@ -269,6 +269,65 @@ mod tests { assert_eq!(fs::read(game.join("saves/slot1.sav")).unwrap(), b"save"); } + /// A game with its {data} caches and saves, as a builder leaves it. + fn game_with_caches(d: &Path) -> PathBuf { + let game = d.join("Game"); + fs::create_dir_all(game.join("recompdata/cache/shaders")).unwrap(); + fs::create_dir_all(game.join("recompdata/saves")).unwrap(); + fs::write(game.join("Game.exe"), b"exe").unwrap(); + fs::write(game.join("recompdata/cache/shaders/pipeline.bin"), b"cache").unwrap(); + fs::write(game.join("recompdata/saves/slot1.sav"), b"save").unwrap(); + game + } + + fn has_caches(game: &Path) -> bool { + fs::read(game.join("recompdata/cache/shaders/pipeline.bin")).ok().as_deref() == Some(b"cache".as_slice()) + && fs::read(game.join("recompdata/saves/slot1.sav")).ok().as_deref() == Some(b"save".as_slice()) + } + + #[test] + fn moving_a_game_carries_its_caches() { + let d = tmp("move-caches"); + let game = game_with_caches(&d); + let to = d.join("other-library").join("Game"); + move_dir(&game, &to, &|_, _| {}).unwrap(); + assert!(has_caches(&to)); + assert!(!game.exists()); + let _ = fs::remove_dir_all(&d); + } + + #[test] + fn copying_a_game_to_another_drive_carries_its_caches() { + // What a move to another drive does: every file, the caches in {data} too. + let d = tmp("copy-caches"); + let game = game_with_caches(&d); + let to = d.join("other-drive").join("Game"); + let total = dir_size(&game); + let mut done = 0; + copy_tree(&game, &to, &mut done, total, &|_, _| {}).unwrap(); + assert!(has_caches(&to)); + assert_eq!(done, total); + let _ = fs::remove_dir_all(&d); + } + + #[test] + fn a_game_moves_into_a_deep_library_folder() { + // Past Windows' old 260-character limit, the launcher's own copying still goes through. + let d = tmp("deep"); + let game = game_with_caches(&d); + let mut lib = d.join("libraries"); + while lib.as_os_str().len() < 300 { + lib = lib.join("a-library-folder-with-a-long-name"); + } + let to = lib.join("Game"); + let mut done = 0; + copy_tree(&game, &to, &mut done, dir_size(&game), &|_, _| {}).unwrap(); + assert!(has_caches(&to)); + move_dir(&game, &lib.join("Game2"), &|_, _| {}).unwrap(); + assert!(has_caches(&lib.join("Game2"))); + let _ = fs::remove_dir_all(&d); + } + #[test] fn nothing_to_back_up_makes_no_backup() { let d = tmp("bk-none"); diff --git a/src-tauri/src/profile.rs b/src-tauri/src/profile.rs index 6fbe131d..033badc7 100644 --- a/src-tauri/src/profile.rs +++ b/src-tauri/src/profile.rs @@ -103,6 +103,10 @@ pub struct Prepare { /// game is set up, even when another launcher built it. #[serde(default, deserialize_with = "paths_lenient", skip_serializing_if = "Vec::is_empty")] pub done: Vec, + /// Environment variables for the step, as `start.env`. Left out of the profile when there are + /// none, so setups fingerprinted before it existed stay as they were. + #[serde(default, skip_serializing_if = "BTreeMap::is_empty")] + pub env: BTreeMap, /// The step keeps what it needs from the copy in the game's build folder (folders.game), and /// runs again from there without the copy: then the arguments with {game} are left out. #[serde(default, skip_serializing_if = "std::ops::Not::not")] @@ -199,6 +203,35 @@ impl Prepare { } impl Prepare { + /// `prepare.env`, filled in; names that aren't allowed are left out, and so is a value with a + /// named input still in it (`with_inputs` fills those in first: an optional DLC the player + /// didn't give is left out, as in `prepare.args`). + pub fn env_vars(&self, install: &Path, copy: Option<&Path>) -> Vec<(String, String)> { + let mut out = vec![]; + for (k, v) in self.env.iter().filter(|(k, _)| env_name_ok(k)) { + // Run again without the copy (keeps_copy): a value naming it is left out, as in args. + if copy.is_none() && v.contains("{game}") { + continue; + } + let value = fill(v, install, copy); + if value.contains("{input:") { + continue; + } + out.push((k.clone(), value)); + } + out + } + + /// The step with the player's named inputs in its arguments and environment. + pub fn with_inputs(&self, inputs: &BTreeMap) -> Prepare { + let mut pr = self.clone(); + // Omit an argument containing an absent optional/conditional token. Put flags in the same + // argument (e.g. --dlc={input:dlc}) so a flag cannot steal the next value. + pr.args = crate::inputs::arguments(&self.args, inputs, false); + pr.env = self.env.iter().map(|(k, v)| (k.clone(), crate::inputs::expand(v, inputs, false))).collect(); + pr + } + /// Its program in the game's folder: a name it gives, or on Linux and Mac the native build by /// the same name (a release's Game-nightly-4-x86_64.AppImage for "Game.AppImage"), as Play /// finds the game's own program. @@ -952,7 +985,7 @@ fn boot_settings(b: &Value) -> (Vec, Vec) { /// out of them. fn safe_place(p: &str) -> bool { let p = p.trim().replace('\\', "/"); - ["{install}/", "{documents}/", "{local}/", "{config}/", "{home}/"].iter().any(|r| p.starts_with(r)) && !p.split('/').any(|c| c == "..") + ["{install}/", "{data}/", "{documents}/", "{local}/", "{config}/", "{home}/"].iter().any(|r| p.starts_with(r)) && !p.split('/').any(|c| c == "..") } /// The player's copy, when the boot profile says it goes on the command line or into a folder: @@ -1181,12 +1214,24 @@ pub fn app_data() -> Option { } } +/// The one folder a game keeps everything it writes in (saves, settings, caches), inside its own +/// folder: `{data}` in its recomplauncher.json, and RECOMPLAUNCHER_DATA when it starts. A name no +/// game uses: releases ship a `data` folder of their own (TotK's does), and 11 catalog games +/// already write or ship a top-level `userdata` (the same folder as `UserData` on Windows). +pub const DATA_DIR: &str = "recompdata"; + +/// `{data}` for a game in `install`. +pub fn data_dir(install: &Path) -> PathBuf { + install.join(DATA_DIR) +} + pub fn fill(t: &str, install: &Path, game: Option<&Path>) -> String { if !t.contains('{') { return t.to_string(); } let s = |p: Option| p.map(|p| p.to_string_lossy().to_string()).unwrap_or_default(); t.replace("{pad}", &PAD.read().unwrap()) + .replace("{data}", &data_dir(install).to_string_lossy()) .replace("{install}", &install.to_string_lossy()) .replace("{documents}", &s(dirs::document_dir().or_else(|| dirs::home_dir().map(|h| h.join("Documents"))))) .replace("{appdata}", &s(app_data())) @@ -1455,7 +1500,7 @@ impl Profile { // A path put into a TOML or JSON string: forward slashes, so the backslashes aren't escapes. let fill = |v: &str, install: &Path, game: Option<&Path>| { let f = fill(v, install, game); - if c.format != "ini" && ["{install}", "{game}", "{documents}", "{local}", "{config}", "{home}"].iter().any(|k| v.contains(k)) { f.replace('\\', "/") } else { f } + if c.format != "ini" && ["{install}", "{data}", "{game}", "{documents}", "{local}", "{config}", "{home}"].iter().any(|k| v.contains(k)) { f.replace('\\', "/") } else { f } }; let Some(path) = place(&c.file, install) else { continue }; let mut f = File::open(path, &c.format); @@ -3983,6 +4028,48 @@ mod tests { assert_eq!(e.len(), 2, "PATH, the launcher's own and bad names stay out: {e:?}"); assert!(env_name_ok("_X1") && !env_name_ok("A-B") && !env_name_ok("path")); } + + #[test] + fn data_fills_in_as_the_recompdata_folder_in_the_game() { + let install = Path::new("/games/x"); + assert_eq!(PathBuf::from(fill("{data}", install, None)), install.join("recompdata")); + assert_eq!(PathBuf::from(fill("{data}/cache", install, None)), install.join("recompdata").join("cache")); + } + + #[test] + fn prepare_env_fills_in_and_keeps_out_what_it_must() { + let p: Profile = serde_json::from_str(r#"{"format":1,"prepare":{"program":["b.exe"],"env":{"BUILD_CACHE":"{data}/cache","DISC":"{game}","TEMP":"x","RECOMPLAUNCHER_DATA":"y"}}}"#).unwrap(); + let pr = p.prepare.unwrap(); + let e = pr.env_vars(Path::new("/games/x"), Some(Path::new("/isos/x.iso"))); + let get = |k: &str| e.iter().find(|(n, _)| n == k).map(|(_, v)| PathBuf::from(v)); + assert_eq!(get("BUILD_CACHE"), Some(Path::new("/games/x").join("recompdata").join("cache"))); + assert_eq!(get("DISC"), Some(PathBuf::from("/isos/x.iso"))); + assert_eq!(e.len(), 2, "TEMP and the launcher's own names stay out: {e:?}"); + } + + #[test] + fn prepare_env_run_again_without_the_copy_leaves_out_what_names_it() { + let p: Profile = serde_json::from_str(r#"{"format":1,"prepare":{"program":["b.exe"],"keeps_copy":true,"env":{"BUILD_CACHE":"{data}/cache","DISC":"{game}"}}}"#).unwrap(); + let e = p.prepare.unwrap().env_vars(Path::new("/games/x"), None); + let names: Vec<&str> = e.iter().map(|(n, _)| n.as_str()).collect(); + assert_eq!(names, ["BUILD_CACHE"]); + } + + #[test] + fn prepare_env_takes_named_inputs_and_drops_a_missing_one() { + let p: Profile = serde_json::from_str(r#"{"format":1,"prepare":{"program":["b.exe"],"env":{"PATCH":"{input:patch}","DLC":"{input:dlc}"}}}"#).unwrap(); + let given = BTreeMap::from([("patch".to_string(), PathBuf::from("/files/patch.zip"))]); + let pr = p.prepare.unwrap().with_inputs(&given); + let e = pr.env_vars(Path::new("/games/x"), None); + assert_eq!(e, vec![("PATCH".to_string(), "/files/patch.zip".to_string())]); + } + + #[test] + fn a_prepare_without_env_writes_none() { + // Setups fingerprinted from the profile before prepare.env existed stay set up. + let p: Profile = serde_json::from_str(r#"{"format":1,"prepare":{"program":["b.exe"]}}"#).unwrap(); + assert!(!serde_json::to_string(&p.prepare.unwrap()).unwrap().contains("env")); + } } #[cfg(test)] diff --git a/src-tauri/src/saves.rs b/src-tauri/src/saves.rs index 33bd16bd..99cfdf8a 100644 --- a/src-tauri/src/saves.rs +++ b/src-tauri/src/saves.rs @@ -33,10 +33,12 @@ const NOT_SAVES: [&str; 37] = [ ".sfc", ".smc", ".gba", ".nds", ".3ds", ".elf", ".rpx", ".exe", ".dll", ".so", ".pdb", ".msi", ".zip", ".7z", ".rar", ".appimage", ".log", ".tmp", ".dmp", ".mp4", ".mkv", ]; -/// Folders that are never saves. -const NOT_SAVE_DIRS: [&str; 16] = [ +/// Folders that are never saves: a game's caches (`{data}/cache`) and temp folders, and the +/// launcher's own work folders in a game's folder (its setup temp folder, the old release an update +/// sets aside), which a save place around them would otherwise take in. +const NOT_SAVE_DIRS: [&str; 19] = [ "mods", "shadercache", "shader_cache", "shaders", "cache", "caches", "logs", "log", "crashdumps", "dumps", "screenshots", ".backups", - "texture_packs", "textures", "packs", "temp", + "texture_packs", "textures", "packs", "temp", "tmp", crate::setup_temp::FOLDER, ".recomplauncher-game-update", ]; /// A place a game keeps its saves. @@ -155,7 +157,9 @@ pub fn templatize_for(p: &Path, g: &Installed) -> String { /// This PC's path as a template that works on any PC: `C:\Users\Ruben\AppData\Local\X` -> `{local}/X`. pub fn templatize(p: &Path, install: &Path) -> String { + // `{data}` before `{install}`: it's inside it, and the narrower name is the one the game uses. let bases: Vec<(&str, Option)> = vec![ + ("{data}", Some(crate::profile::data_dir(install))), ("{install}", Some(install.to_path_buf())), ("{local}", dirs::data_local_dir()), ("{config}", dirs::config_dir()), @@ -984,7 +988,7 @@ pub fn restore(app_dir: &Path, id: &str, zip_file: &Path, spots_now: &[Spot], g: .map(|(i, s)| { let t = &s.template; let whole = t.trim_end_matches(['/', '\\']) == "{install}"; - let in_game = t.starts_with("{install}"); + let in_game = t.starts_with("{install}") || t.starts_with("{data}"); !whole && (!in_game || named(t)) && !roots.get(i).map(|r| holds_programs(r)).unwrap_or(true) }) .collect(); @@ -996,7 +1000,7 @@ pub fn restore(app_dir: &Path, id: &str, zip_file: &Path, spots_now: &[Spot], g: } } let today: HashSet<&str> = spots_now.iter().map(|s| s.template.as_str()).collect(); - let skip: HashSet = same.iter().enumerate().filter(|(i, s)| s.template.starts_with("{install}/") && !today.contains(s.template.as_str()) && roots.get(*i).map(|r| holds_programs(r)).unwrap_or(false)).map(|(i, _)| i).collect(); + let skip: HashSet = same.iter().enumerate().filter(|(i, s)| (s.template.starts_with("{install}/") || s.template.starts_with("{data}/")) && !today.contains(s.template.as_str()) && roots.get(*i).map(|r| holds_programs(r)).unwrap_or(false)).map(|(i, _)| i).collect(); let mut n = 0; for i in 0..z.len() { let mut e = z.by_index(i).map_err(|e| Error::Msg(e.to_string()))?; @@ -1364,6 +1368,68 @@ mod tests { assert!(!state(&app, "g").after_play); } + #[test] + fn a_folder_in_data_is_named_by_data() { + let d = tmp("data-name"); + assert_eq!(templatize(&d.join("recompdata").join("saves"), &d), "{data}/saves"); + assert_eq!(templatize(&d.join("recompdata"), &d), "{data}"); + assert_eq!(templatize(&d.join("save"), &d), "{install}/save"); + let _ = fs::remove_dir_all(&d); + } + + #[test] + fn data_as_a_save_place_leaves_out_caches_and_the_launchers_work_folders() { + let d = tmp("data-skip"); + let data = d.join("recompdata"); + for sub in ["saves", "cache/shaders", ".recomplauncher-tmp", ".recomplauncher-game-update/old", "tmp"] { + fs::create_dir_all(data.join(sub)).unwrap(); + } + fs::write(data.join("saves/slot1.sav"), b"save").unwrap(); + fs::write(data.join("settings.toml"), b"x = 1").unwrap(); + fs::write(data.join("cache/shaders/a.bin"), b"cache").unwrap(); + fs::write(data.join(".recomplauncher-tmp/part.bin"), b"temp").unwrap(); + fs::write(data.join(".recomplauncher-game-update/old/old.sav"), b"old").unwrap(); + fs::write(data.join("tmp/x.sav"), b"temp").unwrap(); + let g = game(&d); + let s = vec![Spot { template: "{data}".into(), from: "developer" }]; + let mut got: Vec = collect(&s, &g).into_iter().map(|e| e.rel).collect(); + got.sort(); + assert_eq!(got, vec!["saves/slot1.sav", "settings.toml"]); + let _ = fs::remove_dir_all(&d); + } + + #[test] + fn the_whole_game_folder_as_a_save_place_leaves_out_the_setup_temp_folder() { + let d = tmp("install-skip"); + fs::create_dir_all(d.join(".recomplauncher-tmp")).unwrap(); + fs::write(d.join(".recomplauncher-tmp/half.sav"), b"temp").unwrap(); + fs::write(d.join("slot1.sav"), b"save").unwrap(); + let g = game(&d); + let s = vec![Spot { template: "{install}".into(), from: "player" }]; + let got: Vec = collect(&s, &g).into_iter().map(|e| e.rel).collect(); + assert_eq!(got, vec!["slot1.sav"]); + let _ = fs::remove_dir_all(&d); + } + + #[test] + fn saves_in_data_are_kept_beside_the_library() { + // What uninstalling with "keep a copy of its saves" relies on: the copy is outside the game. + let d = tmp("data-keep"); + let app = d.join("app"); + let inst = d.join("lib").join("Game"); + fs::create_dir_all(inst.join("recompdata/saves")).unwrap(); + fs::write(inst.join("recompdata/saves/slot1.sav"), b"save").unwrap(); + let g = game(&inst); + let s = vec![Spot { template: "{data}/saves".into(), from: "developer" }]; + assert_eq!(files_inside(&s, &g), vec![PathBuf::from("recompdata").join("saves").join("slot1.sav")]); + let copy = backup(&app, "g", &s, &g).unwrap().unwrap(); + let kept = dir_of(&app, "g", &g).join(©.name); + assert!(kept.is_file() && !kept.starts_with(&inst), "{}", kept.display()); + fs::remove_dir_all(&inst).unwrap(); + assert!(kept.is_file(), "the copy outlives the game's folder"); + let _ = fs::remove_dir_all(&d); + } + #[test] fn nothing_known_means_no_save_places() { let g = game(Path::new("/games/test")); diff --git a/src-tauri/src/setup_temp.rs b/src-tauri/src/setup_temp.rs new file mode 100644 index 00000000..7998079a --- /dev/null +++ b/src-tauri/src/setup_temp.rs @@ -0,0 +1,213 @@ +//! What a setup step (a game's `prepare`) runs with: a temp folder of its own on the game's drive, +//! room on that drive, and plain words when Windows' path limit stops it. Only setup runs get the +//! temp folder: Play keeps the system's. + +use std::path::{Path, PathBuf}; + +/// `/.recomplauncher-tmp`: TMPDIR, TEMP and TMP for one setup run. On the game's drive, so a +/// builder unpacking gigabytes doesn't fill a small system drive (or the memory /tmp is on some +/// Linux systems), and taken away when the run ends. +pub const FOLDER: &str = ".recomplauncher-tmp"; +/// The file inside that says the launcher made the folder, so the launcher may empty it. A folder +/// by that name without it (a release that ships one) is never touched. +const MARK: &str = ".made-by-recomplauncher"; + +/// Room a setup step needs on the game's drive before it starts. +pub const ROOM: u64 = 1 << 30; + +pub const NO_ROOM: &str = "Setup needs at least 1 GB free on the game's drive. Free some up, or move the game to another drive, then try again."; +pub const NOT_OURS: &str = "The game's folder has a .recomplauncher-tmp folder the launcher didn't make, so setup won't use it. Move it out of the game's folder, then try again."; +pub const CANT_MAKE: &str = "Couldn't make a temp folder for setup in the game's folder. Check the drive isn't full or read-only, then try again."; +pub const TOO_LONG: &str = "A path in the game's folder is too long for Windows. Add a library folder with a shorter path in Settings → Games and Folders and move the game there, or turn on Windows' long paths setting (LongPathsEnabled), then try again. The launcher doesn't change that setting for you."; + +/// One setup run's temp folder. Dropping it takes the folder away, whether the run worked, failed +/// or was stopped. +pub struct SetupTemp { + dir: PathBuf, +} + +impl SetupTemp { + /// An empty `/.recomplauncher-tmp` for this run. One left by a run that couldn't clean up + /// (the launcher closed mid-setup) is emptied first, but only when the launcher made it. + pub fn make(install: &Path) -> Result { + let dir = install.join(FOLDER); + if std::fs::symlink_metadata(&dir).is_ok() { + if !made_here(&dir) { + return Err(NOT_OURS); + } + std::fs::remove_dir_all(&dir).map_err(|_| CANT_MAKE)?; + } + std::fs::create_dir_all(&dir).map_err(|_| CANT_MAKE)?; + std::fs::write(dir.join(MARK), b"").map_err(|_| CANT_MAKE)?; + Ok(SetupTemp { dir }) + } + + pub fn path(&self) -> &Path { + &self.dir + } + + /// The names programs read their temp folder from, on Linux, Mac and Windows. + pub fn env(&self) -> [(&'static str, &Path); 3] { + [("TMPDIR", self.dir.as_path()), ("TEMP", self.dir.as_path()), ("TMP", self.dir.as_path())] + } +} + +impl Drop for SetupTemp { + fn drop(&mut self) { + if made_here(&self.dir) { + let _ = std::fs::remove_dir_all(&self.dir); + } + } +} + +/// A real folder (never a link to somewhere else) with the launcher's mark in it. +fn made_here(dir: &Path) -> bool { + let link = std::fs::symlink_metadata(dir).map(|m| m.file_type().is_symlink()).unwrap_or(true); + !link && dir.is_dir() && dir.join(MARK).is_file() +} + +/// Whether a drive with `free` bytes left has room for a setup step. A drive that can't say how +/// much is free (some network folders) gets the benefit of the doubt. +pub fn room_for_setup(free: Option) -> bool { + free.is_none_or(|f| f >= ROOM) +} + +/// Words Windows programs (and their runtimes) print when its 260-character path limit stopped +/// them: .NET's PathTooLongException, Win32's ERROR_FILENAME_EXCED_RANGE (206), and plain ones. +pub fn says_too_long(said: &str) -> bool { + // Not MAX_PATH: it's a constant's name, which a build can print in a warning that stopped nothing. + const WORDS: [&str; 6] = ["path too long", "path is too long", "filename or extension is too long", "pathtoolongexception", "filename_exced_range", "os error 206"]; + let s = said.to_ascii_lowercase(); + WORDS.iter().any(|w| s.contains(w)) +} + +/// TOO_LONG, then what the step said last on a line of its own. A step can print a path warning +/// early and stop later for another reason: its last line keeps that reason in front of the +/// player. The UI translates the first line and leaves the step's own words as they are. +pub fn too_long_with(said: &str) -> String { + if said.is_empty() { + return TOO_LONG.to_string(); + } + format!("{TOO_LONG}\n{said}") +} + +/// An error from Windows' path limit (ERROR_FILENAME_EXCED_RANGE). +pub fn io_too_long(e: &std::io::Error) -> bool { + cfg!(windows) && e.raw_os_error() == Some(206) +} + +#[cfg(test)] +mod tests { + use super::*; + + fn scratch(name: &str) -> PathBuf { + let d = std::env::temp_dir().join(format!("rl-setup-temp-{name}-{}", std::process::id())); + let _ = std::fs::remove_dir_all(&d); + std::fs::create_dir_all(&d).unwrap(); + d + } + + #[test] + fn the_temp_folder_is_made_for_a_run_and_gone_after() { + let d = scratch("run"); + let t = SetupTemp::make(&d).unwrap(); + assert_eq!(t.path(), d.join(FOLDER)); + std::fs::write(t.path().join("unpacked.bin"), b"x").unwrap(); + drop(t); + assert!(!d.join(FOLDER).exists()); + let _ = std::fs::remove_dir_all(&d); + } + + #[test] + fn one_left_by_an_earlier_run_starts_empty() { + let d = scratch("left"); + std::mem::forget(SetupTemp::make(&d).unwrap()); + std::fs::write(d.join(FOLDER).join("old.bin"), b"x").unwrap(); + let t = SetupTemp::make(&d).unwrap(); + assert!(!t.path().join("old.bin").exists()); + drop(t); + let _ = std::fs::remove_dir_all(&d); + } + + #[test] + fn a_folder_the_launcher_didnt_make_is_never_emptied() { + let d = scratch("theirs"); + std::fs::create_dir_all(d.join(FOLDER)).unwrap(); + std::fs::write(d.join(FOLDER).join("release.txt"), b"theirs").unwrap(); + assert_eq!(SetupTemp::make(&d).err(), Some(NOT_OURS)); + assert_eq!(std::fs::read(d.join(FOLDER).join("release.txt")).unwrap(), b"theirs"); + let _ = std::fs::remove_dir_all(&d); + } + + #[test] + fn a_file_by_that_name_is_never_removed() { + let d = scratch("file"); + std::fs::write(d.join(FOLDER), b"a release file").unwrap(); + assert_eq!(SetupTemp::make(&d).err(), Some(NOT_OURS)); + assert_eq!(std::fs::read(d.join(FOLDER)).unwrap(), b"a release file"); + let _ = std::fs::remove_dir_all(&d); + } + + #[test] + fn its_mark_taken_out_mid_run_keeps_the_folder() { + // Something else replaced what the launcher made: it's not the launcher's to delete. + let d = scratch("unmarked"); + let t = SetupTemp::make(&d).unwrap(); + std::fs::remove_file(t.path().join(MARK)).unwrap(); + drop(t); + assert!(d.join(FOLDER).is_dir()); + let _ = std::fs::remove_dir_all(&d); + } + + #[test] + fn it_points_all_three_temp_names_at_it() { + let d = scratch("env"); + let t = SetupTemp::make(&d).unwrap(); + let names: Vec<&str> = t.env().iter().map(|(k, _)| *k).collect(); + assert_eq!(names, ["TMPDIR", "TEMP", "TMP"]); + assert!(t.env().iter().all(|(_, v)| *v == t.path())); + drop(t); + let _ = std::fs::remove_dir_all(&d); + } + + #[test] + fn setup_waits_for_a_gigabyte() { + assert!(room_for_setup(None)); + assert!(room_for_setup(Some(ROOM))); + assert!(!room_for_setup(Some(ROOM - 1))); + } + + #[test] + fn windows_path_limit_messages_are_recognised() { + assert!(says_too_long("Unhandled exception. System.IO.PathTooLongException: The path is too long")); + assert!(says_too_long("error: The filename or extension is too long. (os error 206)")); + assert!(!says_too_long("error: file not found")); + } + + #[test] + fn a_mention_of_max_path_alone_isnt_the_path_limit() { + assert!(!says_too_long("warning: MAX_PATH is 260 on this PC, long paths may not work")); + } + + #[test] + fn the_long_path_message_keeps_what_the_step_said_last() { + assert_eq!(too_long_with("error: out of disk space"), format!("{TOO_LONG}\nerror: out of disk space")); + assert_eq!(too_long_with(""), TOO_LONG); + } + + #[test] + fn a_deep_library_folder_takes_the_temp_folder() { + // Past Windows' old 260-character limit: the launcher's own file work still goes through. + let d = scratch("deep"); + let mut deep = d.clone(); + while deep.as_os_str().len() < 300 { + deep = deep.join("a-library-folder-with-a-long-name"); + } + std::fs::create_dir_all(&deep).unwrap(); + let t = SetupTemp::make(&deep).unwrap(); + std::fs::write(t.path().join("unpacked.bin"), b"x").unwrap(); + drop(t); + assert!(!deep.join(FOLDER).exists()); + let _ = std::fs::remove_dir_all(&d); + } +} diff --git a/tests/i18n-first-line.test.cjs b/tests/i18n-first-line.test.cjs new file mode 100644 index 00000000..6382b093 --- /dev/null +++ b/tests/i18n-first-line.test.cjs @@ -0,0 +1,33 @@ +const { test } = require('node:test'); +const assert = require('node:assert/strict'); +const fs = require('node:fs'); +const path = require('node:path'); +const vm = require('node:vm'); +const read = (f) => fs.readFileSync(path.join(__dirname, '../ui', f), 'utf8'); + +// i18n.js in German, its text read from the real de.json. +async function german() { + const window = {}; + const de = JSON.parse(read('i18n/de.json')); + const fetch = async () => ({ ok: true, json: async () => de }); + const document = { documentElement: {} }; + vm.runInNewContext(read('i18n.js'), { window, navigator: { languages: ['de-DE'] }, document, fetch }); + await window.loadLang('de'); + return { t: window.t, de }; +} + +const TOO_LONG = "A path in the game's folder is too long for Windows. Add a library folder with a shorter path in Settings → Games and Folders and move the game there, or turn on Windows' long paths setting (LongPathsEnabled), then try again. The launcher doesn't change that setting for you."; + +test('a launcher text with a program line under it is translated, and the program line kept', async () => { + const { t, de } = await german(); + assert.equal(t(`${TOO_LONG}\nerror: out of disk space`), `${de[TOO_LONG]}\nerror: out of disk space`); +}); + +test('a text whose first line the launcher does not know stays as it is', async () => { + const { t } = await german(); + assert.equal(t('something a program said\nand more'), 'something a program said\nand more'); +}); + +test('the desktop setup error keeps its lines apart', () => { + assert.match(read('app.css'), /\.su-err\{[^}]*white-space:pre-line/); +}); diff --git a/tests/uninstall-keep-saves.test.cjs b/tests/uninstall-keep-saves.test.cjs new file mode 100644 index 00000000..e8c3289d --- /dev/null +++ b/tests/uninstall-keep-saves.test.cjs @@ -0,0 +1,61 @@ +const { test } = require('node:test'); +const assert = require('node:assert/strict'); +const fs = require('node:fs'); +const path = require('node:path'); +const read = (f) => fs.readFileSync(path.join(__dirname, '../ui', f), 'utf8'); +const app = read('app.js'), tv = read('tv.js'); + +// A function declaration out of a file, by name. +function fn(src, name) { + const start = src.indexOf(`function ${name}(`); + assert.ok(start >= 0, name); + let i = src.indexOf('{', start), depth = 0; + for (; i < src.length; i++) { + if (src[i] === '{') depth++; + if (src[i] === '}' && --depth === 0) break; + } + return src.slice(start, i + 1); +} + +test('the desktop uninstall keeps a copy of the saves unless the tick is taken off', () => { + const u = fn(app, 'confirmUninstall'); + assert.match(u, //); + assert.match(u, /keep = !!\(\$\('#u-keep', s\) \|\| \{\}\)\.checked/); + assert.match(u, /invoke\('uninstall', \{ id, deleteFiles: del, runUninstaller: unins, keepSaves: keep \}\)/); +}); + +test('the desktop keep-saves tick is off while the folder stays', () => { + const u = fn(app, 'confirmUninstall'); + assert.match(u, /delBox\.addEventListener\('change', \(\) => \{ keepBox\.disabled = !delBox\.checked; \}\)/); +}); + +test('the desktop says where the saves went, or why the folder stayed', () => { + const u = fn(app, 'confirmUninstall'); + assert.match(u, /if \(r\.saves_kept\) toast\(t\('A copy of its saves is kept\./); + assert.match(u, /else if \(del && r\.kept && r\.saves_stuck\) toast\(/); +}); + +test('Big Picture offers the same: delete keeping a copy, or delete the saves too', () => { + const u = fn(tv, 'tvUninstall'); + assert.match(u, /const run = \(del, keep = true\) =>/); + assert.match(u, /invoke\('uninstall', \{ id, deleteFiles: del, keepSaves: keep \}\)/); + assert.match(u, /label: t\('Uninstall and delete its folder'\), sub: tf\('\{path\}\. A copy of its saves is kept first\.'/); + assert.match(u, /label: t\('Delete its folder and its saves'\)[^\n]*run: run\(true, false\)/); + assert.match(u, /if \(r\.saves_kept\) toast\(/); + assert.match(u, /r\.saves_stuck/); +}); + +test('every new uninstall text is in every language', () => { + const texts = [ + 'Keep a copy of its saves first, to put back if you install it again', + "{name} is uninstalled, but its folder stayed: a copy of its saves couldn't be made first. It's in {path}.", + 'A copy of its saves is kept. Install it again and put them back from its Saves tab.', + '{path}. A copy of its saves is kept first.', + 'Delete its folder and its saves', + ]; + const dir = path.join(__dirname, '../ui/i18n'); + for (const f of fs.readdirSync(dir).filter((x) => x.endsWith('.json') && x !== 'en-GB.json')) { + const d = JSON.parse(fs.readFileSync(path.join(dir, f), 'utf8')); + for (const s of texts) assert.ok(d[s], `${f}: ${s}`); + } +}); diff --git a/ui/app.css b/ui/app.css index 45a7be2f..a2e21b17 100644 --- a/ui/app.css +++ b/ui/app.css @@ -641,6 +641,7 @@ button.prog.su-prog:focus-visible,.prog.su-prog:focus-visible{outline:2px solid .modal p{margin:0;color:var(--muted);overflow-wrap:anywhere} .modal .acts{justify-content:flex-end} .modal label{display:flex;gap:10px;align-items:center;font-size:14px} +.modal label:has(> input:disabled){opacity:.5} .modal .field{margin:2px 0 4px} .modal:has(.choices){width:min(620px,92vw)} .choices{display:flex;flex-direction:column;gap:8px;max-height:46vh;overflow:auto} @@ -723,7 +724,7 @@ body.light .pick .fmt,body.light .ready .set-row .k .fmt{background:rgba(20,120, .su-r .picks .btn{width:100%} .ni-content,.ni-tv{display:flex;flex-direction:column;min-height:0;gap:18px} .ni-notice p{margin:0 0 10px;color:var(--muted)} -.su-err{color:#ffc2c2} +.su-err{color:#ffc2c2;white-space:pre-line} /* ---------- Easy Setup in steps (setup-steps.js) ---------- One height for every step, the list scrolling inside it, so Back, the line by the button and Next/Set Up never move. The copy's box keeps its size and buttons whether it's empty or filled. */ diff --git a/ui/app.js b/ui/app.js index 55bda091..edfa95ae 100644 --- a/ui/app.js +++ b/ui/app.js @@ -6082,30 +6082,35 @@ function confirmUninstall(id) {

${esc(t('It comes out of your Library. You can install it again from the Catalog any time.'))}

${many ? `

${esc(tf('Its {n} games are uninstalled with it: {games}.', { n: many.length, games: many.map((x) => x.name).join(', ') }))}

` : ''} ${g.exe && /^([a-z]:[\\/]|\\\\|\/)/i.test(g.exe) && !String(g.exe).toLowerCase().startsWith(String(g.path).toLowerCase()) ? `

${esc(t('Its own installer put the game somewhere else. With the box ticked, its own uninstaller opens too.'))}

` : ''} - ${g.installer ? `

${esc(tf('Without it, only the Library forgets it. Its folder stays where it is: {path}', { path: g.path }))}

` : g.installer_setup ? '' : ownFolder(g) ? `` : `

${esc(tf('Its folder stays where it is: {path}', { path: g.path }))}

`} + ${g.installer ? `

${esc(tf('Without it, only the Library forgets it. Its folder stays where it is: {path}', { path: g.path }))}

` : g.installer_setup ? '' : ownFolder(g) ? `` : `

${esc(tf('Its folder stays where it is: {path}', { path: g.path }))}

`}
`; document.body.append(s); $('[data-x="no"]', s).focus(); + // A copy of the saves is made only when the folder goes: with it kept, the tick means nothing. + const delBox = $('#u-del', s), keepBox = $('#u-keep', s); + if (delBox && keepBox) delBox.addEventListener('change', () => { keepBox.disabled = !delBox.checked; }); s.addEventListener('click', async (e) => { const x = e.target.closest('[data-x]'); if (e.target === s || (x && x.dataset.x === 'no')) return s.remove(); if (!x) return; - const del = !!($('#u-del', s) || {}).checked, unins = !!($('#u-unins', s) || {}).checked; + const del = !!($('#u-del', s) || {}).checked, unins = !!($('#u-unins', s) || {}).checked, keep = !!($('#u-keep', s) || {}).checked; s.remove(); if (unins) toast(tf('{name}\'s uninstaller is opening. Finish it there.', { name: g.name })); let r = {}; - try { r = (await invoke('uninstall', { id, deleteFiles: del, runUninstaller: unins })) || {}; } catch (err) { await refreshState(); render(true); return fail(err); } + try { r = (await invoke('uninstall', { id, deleteFiles: del, runUninstaller: unins, keepSaves: keep })) || {}; } catch (err) { await refreshState(); render(true); return fail(err); } if (window.usageUninstall) window.usageUninstall(id); await keepOut(id); delete S.updates[id]; await refreshState(); render(true); // Some files couldn't go (still in use by something): say where they are. if (r.left) toast(tf('{name} is uninstalled, but a few of its files are still in use and stayed in {path}. Close whatever is using them (or restart), then delete that folder.', { name: g.name, path: r.path }), true); + else if (del && r.kept && r.saves_stuck) toast(tf('{name} is uninstalled, but its folder stayed: a copy of its saves couldn\'t be made first. It\'s in {path}.', { name: g.name, path: r.path }), true); else if (del && r.kept && r.copy_stuck) toast(tf('{name} is uninstalled, but its folder stayed: your copy of the game is inside it and couldn\'t be moved out. It\'s in {path}.', { name: g.name, path: r.path }), true); else if (r.installer) toast(r.uninstaller ? tf('{name} is uninstalled.', { name: g.name }) : tf('{name} is out of your Library. Its folder stays in {path}.', { name: g.name, path: r.path })); else if (r.uninstaller) toast(tf('{name} is uninstalled. Its own uninstaller is open to remove the game from where it installed it.', { name: g.name })); else toast(tf('{name} is uninstalled.', { name: g.name })); // The player's own files that were inside its folder: said apart, whatever else happened. if (r.kept_copy) toast(tf('Your copy of the game was inside its folder, so it\'s kept in {path}.', { path: r.kept_copy })); + if (r.saves_kept) toast(t('A copy of its saves is kept. Install it again and put them back from its Saves tab.')); }); s.addEventListener('keydown', (e) => { if (e.key === 'Escape') s.remove(); }); } diff --git a/ui/i18n.js b/ui/i18n.js index 2cd62791..63094457 100644 --- a/ui/i18n.js +++ b/ui/i18n.js @@ -13,7 +13,10 @@ let lang = 'en'; let dict = {}; const has = (s) => Object.prototype.hasOwnProperty.call(dict, s) && dict[s]; - const t = (s) => (s == null ? '' : has(s) ? dict[s] : s); + // A launcher text with what a program printed under it, on lines of its own: the text is + // translated, and the program's words stay as it printed them. + const firstLine = (s) => { const nl = s.indexOf('\n'); return nl > 0 && has(s.slice(0, nl)) ? dict[s.slice(0, nl)] + s.slice(nl) : s; }; + const t = (s) => (s == null ? '' : has(s) ? dict[s] : typeof s === 'string' ? firstLine(s) : s); // English in a table that t() is given later. const N_ = (s) => s; const locale = () => (lang === 'ar' ? 'ar-u-nu-latn' : lang); diff --git a/ui/i18n/ar.json b/ui/i18n/ar.json index fcc111f1..96eb21c8 100644 --- a/ui/i18n/ar.json +++ b/ui/i18n/ar.json @@ -3361,5 +3361,14 @@ "Every installed game takes a new release as soon as the launcher finds one": "تحصل كل لعبة مثبتة على الإصدار الجديد فور عثور المشغل عليه", "Turn off automatic updates": "إيقاف التحديثات التلقائية", "Updates wait for you in Downloads": "التحديثات تنتظرك في «التنزيلات»", + "Setup needs at least 1 GB free on the game's drive. Free some up, or move the game to another drive, then try again.": "يحتاج الإعداد إلى 1 غيغابايت فارغة على الأقل على محرك أقراص اللعبة. حرّر بعض المساحة أو انقل اللعبة إلى محرك أقراص آخر، ثم حاول مرة أخرى.", + "The game's folder has a .recomplauncher-tmp folder the launcher didn't make, so setup won't use it. Move it out of the game's folder, then try again.": "في مجلد اللعبة مجلد .recomplauncher-tmp لم ينشئه المشغل، لذلك لن يستخدمه الإعداد. انقله خارج مجلد اللعبة، ثم حاول مرة أخرى.", + "Couldn't make a temp folder for setup in the game's folder. Check the drive isn't full or read-only, then try again.": "تعذّر إنشاء مجلد مؤقت للإعداد في مجلد اللعبة. تأكد من أن محرك الأقراص ليس ممتلئًا ولا للقراءة فقط، ثم حاول مرة أخرى.", + "A path in the game's folder is too long for Windows. Add a library folder with a shorter path in Settings → Games and Folders and move the game there, or turn on Windows' long paths setting (LongPathsEnabled), then try again. The launcher doesn't change that setting for you.": "أحد المسارات في مجلد اللعبة أطول مما يحتمله Windows. أضف مجلد مكتبة بمسار أقصر من الإعدادات → الألعاب والمجلدات وانقل اللعبة إليه، أو شغّل إعداد المسارات الطويلة في Windows (LongPathsEnabled)، ثم حاول مرة أخرى. لا يغيّر المشغل هذا الإعداد نيابة عنك.", + "Keep a copy of its saves first, to put back if you install it again": "الاحتفاظ بنسخة من ملفات الحفظ أولًا، لإعادتها إذا ثبّتها مرة أخرى", + "{name} is uninstalled, but its folder stayed: a copy of its saves couldn't be made first. It's in {path}.": "تمت إزالة {name}، لكن مجلده بقي: تعذّر عمل نسخة من ملفات الحفظ أولًا. المجلد في {path}.", + "A copy of its saves is kept. Install it again and put them back from its Saves tab.": "تم الاحتفاظ بنسخة من ملفات الحفظ. ثبّت اللعبة مرة أخرى وأعدها من علامة التبويب «ملفات الحفظ».", + "{path}. A copy of its saves is kept first.": "{path}. يُحتفظ بنسخة من ملفات الحفظ أولًا.", + "Delete its folder and its saves": "حذف مجلدها وملفات الحفظ", "N/A": "غير متاح" } diff --git a/ui/i18n/de.json b/ui/i18n/de.json index 17892a41..21a872ec 100644 --- a/ui/i18n/de.json +++ b/ui/i18n/de.json @@ -3361,5 +3361,14 @@ "Every installed game takes a new release as soon as the launcher finds one": "Jedes installierte Spiel bekommt ein neues Release, sobald der Launcher es findet", "Turn off automatic updates": "Automatische Updates ausschalten", "Updates wait for you in Downloads": "Updates warten unter Downloads auf dich", + "Setup needs at least 1 GB free on the game's drive. Free some up, or move the game to another drive, then try again.": "Für die Einrichtung braucht das Laufwerk des Spiels mindestens 1 GB freien Platz. Mach etwas Platz frei oder verschieb das Spiel auf ein anderes Laufwerk und versuch es dann noch einmal.", + "The game's folder has a .recomplauncher-tmp folder the launcher didn't make, so setup won't use it. Move it out of the game's folder, then try again.": "Im Ordner des Spiels liegt ein Ordner .recomplauncher-tmp, den nicht der Launcher angelegt hat, deshalb nutzt die Einrichtung ihn nicht. Verschieb ihn aus dem Ordner des Spiels und versuch es dann noch einmal.", + "Couldn't make a temp folder for setup in the game's folder. Check the drive isn't full or read-only, then try again.": "Im Ordner des Spiels konnte kein temporärer Ordner für die Einrichtung angelegt werden. Prüf, ob das Laufwerk voll oder schreibgeschützt ist, und versuch es dann noch einmal.", + "A path in the game's folder is too long for Windows. Add a library folder with a shorter path in Settings → Games and Folders and move the game there, or turn on Windows' long paths setting (LongPathsEnabled), then try again. The launcher doesn't change that setting for you.": "Ein Pfad im Ordner des Spiels ist für Windows zu lang. Füg unter Einstellungen → Spiele und Ordner einen Bibliotheksordner mit kürzerem Pfad hinzu und verschieb das Spiel dorthin, oder schalte die Windows-Einstellung für lange Pfade (LongPathsEnabled) ein und versuch es dann noch einmal. Der Launcher ändert diese Einstellung nicht für dich.", + "Keep a copy of its saves first, to put back if you install it again": "Vorher eine Kopie der Spielstände behalten, um sie nach einer Neuinstallation zurückzuspielen", + "{name} is uninstalled, but its folder stayed: a copy of its saves couldn't be made first. It's in {path}.": "{name} ist deinstalliert, aber der Ordner ist geblieben: Vorher konnte keine Kopie der Spielstände erstellt werden. Er liegt in {path}.", + "A copy of its saves is kept. Install it again and put them back from its Saves tab.": "Eine Kopie der Spielstände bleibt erhalten. Installier das Spiel erneut und spiel sie im Tab „Spielstände“ zurück.", + "{path}. A copy of its saves is kept first.": "{path}. Vorher wird eine Kopie der Spielstände behalten.", + "Delete its folder and its saves": "Ordner und Spielstände löschen", "N/A": "k. A." } diff --git a/ui/i18n/es-419.json b/ui/i18n/es-419.json index 2d735422..8f55334f 100644 --- a/ui/i18n/es-419.json +++ b/ui/i18n/es-419.json @@ -3361,5 +3361,14 @@ "Every installed game takes a new release as soon as the launcher finds one": "Cada juego instalado recibe una versión nueva en cuanto el lanzador la encuentra", "Turn off automatic updates": "Desactivar las actualizaciones automáticas", "Updates wait for you in Downloads": "Las actualizaciones te esperan en Descargas", + "Setup needs at least 1 GB free on the game's drive. Free some up, or move the game to another drive, then try again.": "La configuración necesita al menos 1 GB libre en la unidad del juego. Libera un poco o mueve el juego a otra unidad y vuelve a intentarlo.", + "The game's folder has a .recomplauncher-tmp folder the launcher didn't make, so setup won't use it. Move it out of the game's folder, then try again.": "La carpeta del juego tiene una carpeta .recomplauncher-tmp que no creó el lanzador, así que la configuración no la va a usar. Sácala de la carpeta del juego y vuelve a intentarlo.", + "Couldn't make a temp folder for setup in the game's folder. Check the drive isn't full or read-only, then try again.": "No se pudo crear una carpeta temporal para la configuración en la carpeta del juego. Revisa que la unidad no esté llena ni sea de solo lectura y vuelve a intentarlo.", + "A path in the game's folder is too long for Windows. Add a library folder with a shorter path in Settings → Games and Folders and move the game there, or turn on Windows' long paths setting (LongPathsEnabled), then try again. The launcher doesn't change that setting for you.": "Una ruta de la carpeta del juego es demasiado larga para Windows. Agrega una carpeta de biblioteca con una ruta más corta en Configuración → Juegos y carpetas y mueve el juego ahí, o activa la configuración de rutas largas de Windows (LongPathsEnabled) y vuelve a intentarlo. El lanzador no cambia esa configuración por ti.", + "Keep a copy of its saves first, to put back if you install it again": "Guardar antes una copia de sus partidas, para recuperarlas si lo vuelves a instalar", + "{name} is uninstalled, but its folder stayed: a copy of its saves couldn't be made first. It's in {path}.": "{name} se desinstaló, pero su carpeta se quedó: no se pudo hacer antes una copia de sus partidas. Está en {path}.", + "A copy of its saves is kept. Install it again and put them back from its Saves tab.": "Se guarda una copia de sus partidas. Vuelve a instalarlo y recupéralas desde su pestaña Partidas.", + "{path}. A copy of its saves is kept first.": "{path}. Antes se guarda una copia de sus partidas.", + "Delete its folder and its saves": "Borrar su carpeta y sus partidas", "N/A": "N/D" } diff --git a/ui/i18n/es.json b/ui/i18n/es.json index 6ed63a6c..c6bf0ec1 100644 --- a/ui/i18n/es.json +++ b/ui/i18n/es.json @@ -3361,5 +3361,14 @@ "Every installed game takes a new release as soon as the launcher finds one": "Cada juego instalado recibe una versión nueva en cuanto el lanzador la encuentra", "Turn off automatic updates": "Desactivar las actualizaciones automáticas", "Updates wait for you in Downloads": "Las actualizaciones te esperan en Descargas", + "Setup needs at least 1 GB free on the game's drive. Free some up, or move the game to another drive, then try again.": "La configuración necesita al menos 1 GB libre en la unidad del juego. Libera un poco o mueve el juego a otra unidad y vuelve a intentarlo.", + "The game's folder has a .recomplauncher-tmp folder the launcher didn't make, so setup won't use it. Move it out of the game's folder, then try again.": "La carpeta del juego tiene una carpeta .recomplauncher-tmp que no creó el lanzador, así que la configuración no la usará. Sácala de la carpeta del juego y vuelve a intentarlo.", + "Couldn't make a temp folder for setup in the game's folder. Check the drive isn't full or read-only, then try again.": "No se pudo crear una carpeta temporal para la configuración en la carpeta del juego. Comprueba que la unidad no esté llena ni sea de solo lectura y vuelve a intentarlo.", + "A path in the game's folder is too long for Windows. Add a library folder with a shorter path in Settings → Games and Folders and move the game there, or turn on Windows' long paths setting (LongPathsEnabled), then try again. The launcher doesn't change that setting for you.": "Una ruta de la carpeta del juego es demasiado larga para Windows. Añade una carpeta de biblioteca con una ruta más corta en Configuración → Juegos y carpetas y mueve el juego allí, o activa el ajuste de rutas largas de Windows (LongPathsEnabled) y vuelve a intentarlo. El lanzador no cambia ese ajuste por ti.", + "Keep a copy of its saves first, to put back if you install it again": "Guardar antes una copia de sus partidas, para recuperarlas si lo vuelves a instalar", + "{name} is uninstalled, but its folder stayed: a copy of its saves couldn't be made first. It's in {path}.": "{name} se ha desinstalado, pero su carpeta se ha quedado: no se pudo hacer antes una copia de sus partidas. Está en {path}.", + "A copy of its saves is kept. Install it again and put them back from its Saves tab.": "Se guarda una copia de sus partidas. Vuelve a instalarlo y recupéralas desde su pestaña Partidas.", + "{path}. A copy of its saves is kept first.": "{path}. Antes se guarda una copia de sus partidas.", + "Delete its folder and its saves": "Borrar su carpeta y sus partidas", "N/A": "N/D" } diff --git a/ui/i18n/fr-CA.json b/ui/i18n/fr-CA.json index 3291d228..bccee029 100644 --- a/ui/i18n/fr-CA.json +++ b/ui/i18n/fr-CA.json @@ -1470,5 +1470,14 @@ "Checked by the RecompStore team": "Vérifié par l’équipe RecompStore", "Open the VirusTotal report": "Ouvrir le rapport VirusTotal", "Safe": "Sûr", - "Safe Update": "Mise à jour sûre" + "Safe Update": "Mise à jour sûre", + "Setup needs at least 1 GB free on the game's drive. Free some up, or move the game to another drive, then try again.": "La configuration a besoin d'au moins 1 Go libre sur le lecteur du jeu. Libère de l'espace ou déplace le jeu sur un autre lecteur, puis réessaie.", + "The game's folder has a .recomplauncher-tmp folder the launcher didn't make, so setup won't use it. Move it out of the game's folder, then try again.": "Le dossier du jeu contient un dossier .recomplauncher-tmp que le lanceur n'a pas créé, donc la configuration ne l'utilise pas. Sors-le du dossier du jeu, puis réessaie.", + "Couldn't make a temp folder for setup in the game's folder. Check the drive isn't full or read-only, then try again.": "Impossible de créer un dossier temporaire pour la configuration dans le dossier du jeu. Vérifie que le lecteur n'est pas plein ni en lecture seule, puis réessaie.", + "A path in the game's folder is too long for Windows. Add a library folder with a shorter path in Settings → Games and Folders and move the game there, or turn on Windows' long paths setting (LongPathsEnabled), then try again. The launcher doesn't change that setting for you.": "Un chemin dans le dossier du jeu est trop long pour Windows. Ajoute un dossier de bibliothèque avec un chemin plus court dans Paramètres → Jeux et dossiers et déplaces-y le jeu, ou active le réglage des chemins longs de Windows (LongPathsEnabled), puis réessaie. Le lanceur ne modifie pas ce réglage à ta place.", + "Keep a copy of its saves first, to put back if you install it again": "Garder d'abord une copie de ses sauvegardes, à remettre si tu le réinstalles", + "{name} is uninstalled, but its folder stayed: a copy of its saves couldn't be made first. It's in {path}.": "{name} est désinstallé, mais son dossier est resté : une copie de ses sauvegardes n'a pas pu être faite avant. Il est dans {path}.", + "A copy of its saves is kept. Install it again and put them back from its Saves tab.": "Une copie de ses sauvegardes est gardée. Réinstalle-le et remets-les depuis son onglet Sauvegardes.", + "{path}. A copy of its saves is kept first.": "{path}. Une copie de ses sauvegardes est gardée avant.", + "Delete its folder and its saves": "Supprimer son dossier et ses sauvegardes" } diff --git a/ui/i18n/fr.json b/ui/i18n/fr.json index eda84bc0..792551a9 100644 --- a/ui/i18n/fr.json +++ b/ui/i18n/fr.json @@ -3361,5 +3361,14 @@ "Every installed game takes a new release as soon as the launcher finds one": "Chaque jeu installé reçoit une nouvelle version dès que le lanceur la trouve", "Turn off automatic updates": "Désactiver les mises à jour automatiques", "Updates wait for you in Downloads": "Les mises à jour vous attendent dans Téléchargements", + "Setup needs at least 1 GB free on the game's drive. Free some up, or move the game to another drive, then try again.": "La configuration a besoin d'au moins 1 Go libre sur le lecteur du jeu. Libérez de l'espace ou déplacez le jeu sur un autre lecteur, puis réessayez.", + "The game's folder has a .recomplauncher-tmp folder the launcher didn't make, so setup won't use it. Move it out of the game's folder, then try again.": "Le dossier du jeu contient un dossier .recomplauncher-tmp que le lanceur n'a pas créé, donc la configuration ne l'utilise pas. Sortez-le du dossier du jeu, puis réessayez.", + "Couldn't make a temp folder for setup in the game's folder. Check the drive isn't full or read-only, then try again.": "Impossible de créer un dossier temporaire pour la configuration dans le dossier du jeu. Vérifiez que le lecteur n'est pas plein ni en lecture seule, puis réessayez.", + "A path in the game's folder is too long for Windows. Add a library folder with a shorter path in Settings → Games and Folders and move the game there, or turn on Windows' long paths setting (LongPathsEnabled), then try again. The launcher doesn't change that setting for you.": "Un chemin dans le dossier du jeu est trop long pour Windows. Ajoutez un dossier de bibliothèque avec un chemin plus court dans Paramètres → Jeux et dossiers et déplacez-y le jeu, ou activez le réglage des chemins longs de Windows (LongPathsEnabled), puis réessayez. Le lanceur ne modifie pas ce réglage à votre place.", + "Keep a copy of its saves first, to put back if you install it again": "Garder d'abord une copie de ses sauvegardes, à remettre si vous le réinstallez", + "{name} is uninstalled, but its folder stayed: a copy of its saves couldn't be made first. It's in {path}.": "{name} est désinstallé, mais son dossier est resté : une copie de ses sauvegardes n'a pas pu être faite avant. Il est dans {path}.", + "A copy of its saves is kept. Install it again and put them back from its Saves tab.": "Une copie de ses sauvegardes est gardée. Réinstallez-le et remettez-les depuis son onglet Sauvegardes.", + "{path}. A copy of its saves is kept first.": "{path}. Une copie de ses sauvegardes est gardée avant.", + "Delete its folder and its saves": "Supprimer son dossier et ses sauvegardes", "N/A": "N/D" } diff --git a/ui/i18n/id.json b/ui/i18n/id.json index 6062ed8f..8a96e99f 100644 --- a/ui/i18n/id.json +++ b/ui/i18n/id.json @@ -3361,5 +3361,14 @@ "Every installed game takes a new release as soon as the launcher finds one": "Setiap game yang terpasang mendapat rilis baru begitu launcher menemukannya", "Turn off automatic updates": "Matikan pembaruan otomatis", "Updates wait for you in Downloads": "Pembaruan menunggumu di Unduhan", + "Setup needs at least 1 GB free on the game's drive. Free some up, or move the game to another drive, then try again.": "Penyiapan butuh ruang kosong minimal 1 GB di drive game. Kosongkan sedikit ruang, atau pindahkan game ke drive lain, lalu coba lagi.", + "The game's folder has a .recomplauncher-tmp folder the launcher didn't make, so setup won't use it. Move it out of the game's folder, then try again.": "Folder game punya folder .recomplauncher-tmp yang tidak dibuat oleh launcher, jadi penyiapan tidak memakainya. Pindahkan folder itu keluar dari folder game, lalu coba lagi.", + "Couldn't make a temp folder for setup in the game's folder. Check the drive isn't full or read-only, then try again.": "Tidak bisa membuat folder sementara untuk penyiapan di folder game. Pastikan drive tidak penuh atau hanya-baca, lalu coba lagi.", + "A path in the game's folder is too long for Windows. Add a library folder with a shorter path in Settings → Games and Folders and move the game there, or turn on Windows' long paths setting (LongPathsEnabled), then try again. The launcher doesn't change that setting for you.": "Ada path di folder game yang terlalu panjang untuk Windows. Tambahkan folder pustaka dengan path lebih pendek di Pengaturan → Game dan folder lalu pindahkan game ke sana, atau nyalakan pengaturan path panjang Windows (LongPathsEnabled), lalu coba lagi. Launcher tidak mengubah pengaturan itu untukmu.", + "Keep a copy of its saves first, to put back if you install it again": "Simpan salinan save-nya dulu, untuk dikembalikan kalau kamu memasangnya lagi", + "{name} is uninstalled, but its folder stayed: a copy of its saves couldn't be made first. It's in {path}.": "{name} sudah di-uninstall, tapi foldernya tetap ada: salinan save-nya tidak bisa dibuat dulu. Foldernya di {path}.", + "A copy of its saves is kept. Install it again and put them back from its Saves tab.": "Salinan save-nya disimpan. Pasang lagi game-nya dan kembalikan save dari tab Save.", + "{path}. A copy of its saves is kept first.": "{path}. Salinan save-nya disimpan dulu.", + "Delete its folder and its saves": "Hapus folder dan save-nya", "N/A": "Tidak ada" } diff --git a/ui/i18n/it.json b/ui/i18n/it.json index 04a600e4..63ea33fe 100644 --- a/ui/i18n/it.json +++ b/ui/i18n/it.json @@ -3361,5 +3361,14 @@ "Every installed game takes a new release as soon as the launcher finds one": "Ogni gioco installato riceve una nuova release appena il launcher la trova", "Turn off automatic updates": "Disattiva gli aggiornamenti automatici", "Updates wait for you in Downloads": "Gli aggiornamenti ti aspettano in Download", + "Setup needs at least 1 GB free on the game's drive. Free some up, or move the game to another drive, then try again.": "La configurazione richiede almeno 1 GB libero sull'unità del gioco. Libera un po' di spazio o sposta il gioco su un'altra unità, poi riprova.", + "The game's folder has a .recomplauncher-tmp folder the launcher didn't make, so setup won't use it. Move it out of the game's folder, then try again.": "La cartella del gioco ha una cartella .recomplauncher-tmp che non ha creato il launcher, quindi la configurazione non la usa. Spostala fuori dalla cartella del gioco, poi riprova.", + "Couldn't make a temp folder for setup in the game's folder. Check the drive isn't full or read-only, then try again.": "Impossibile creare una cartella temporanea per la configurazione nella cartella del gioco. Controlla che l'unità non sia piena o di sola lettura, poi riprova.", + "A path in the game's folder is too long for Windows. Add a library folder with a shorter path in Settings → Games and Folders and move the game there, or turn on Windows' long paths setting (LongPathsEnabled), then try again. The launcher doesn't change that setting for you.": "Un percorso nella cartella del gioco è troppo lungo per Windows. Aggiungi una cartella della libreria con un percorso più corto in Impostazioni → Giochi e cartelle e sposta lì il gioco, oppure attiva l'impostazione dei percorsi lunghi di Windows (LongPathsEnabled), poi riprova. Il launcher non cambia questa impostazione al posto tuo.", + "Keep a copy of its saves first, to put back if you install it again": "Tieni prima una copia dei suoi salvataggi, da rimettere se lo reinstalli", + "{name} is uninstalled, but its folder stayed: a copy of its saves couldn't be made first. It's in {path}.": "{name} è disinstallato, ma la sua cartella è rimasta: non è stato possibile fare prima una copia dei suoi salvataggi. Si trova in {path}.", + "A copy of its saves is kept. Install it again and put them back from its Saves tab.": "Una copia dei suoi salvataggi viene tenuta. Reinstallalo e rimettili dalla sua scheda Salvataggi.", + "{path}. A copy of its saves is kept first.": "{path}. Prima viene tenuta una copia dei suoi salvataggi.", + "Delete its folder and its saves": "Elimina la cartella e i salvataggi", "N/A": "N/D" } diff --git a/ui/i18n/ja.json b/ui/i18n/ja.json index 771be161..33c7c5dc 100644 --- a/ui/i18n/ja.json +++ b/ui/i18n/ja.json @@ -3361,5 +3361,14 @@ "Every installed game takes a new release as soon as the launcher finds one": "インストール済みのゲームはすべて、ランチャーが新しいリリースを見つけたらすぐにアップデートされます", "Turn off automatic updates": "自動アップデートをオフにする", "Updates wait for you in Downloads": "アップデートは「ダウンロード」で待っています", + "Setup needs at least 1 GB free on the game's drive. Free some up, or move the game to another drive, then try again.": "セットアップには、ゲームのドライブに 1 GB 以上の空き容量が必要です。空き容量を増やすか、ゲームを別のドライブに移してから、もう一度お試しください。", + "The game's folder has a .recomplauncher-tmp folder the launcher didn't make, so setup won't use it. Move it out of the game's folder, then try again.": "ゲームのフォルダーに、ランチャーが作ったものではない .recomplauncher-tmp フォルダーがあるため、セットアップでは使いません。ゲームのフォルダーの外に移してから、もう一度お試しください。", + "Couldn't make a temp folder for setup in the game's folder. Check the drive isn't full or read-only, then try again.": "ゲームのフォルダーにセットアップ用の一時フォルダーを作れませんでした。ドライブがいっぱいでないか、読み取り専用でないかを確認してから、もう一度お試しください。", + "A path in the game's folder is too long for Windows. Add a library folder with a shorter path in Settings → Games and Folders and move the game there, or turn on Windows' long paths setting (LongPathsEnabled), then try again. The launcher doesn't change that setting for you.": "ゲームのフォルダー内のパスが Windows には長すぎます。「設定」→「ゲームとフォルダー」でパスの短いライブラリのフォルダーを追加してゲームをそこへ移すか、Windows の長いパスの設定 (LongPathsEnabled) をオンにしてから、もう一度お試しください。ランチャーがこの設定を変更することはありません。", + "Keep a copy of its saves first, to put back if you install it again": "先にセーブデータのコピーを残し、再インストールしたときに戻せるようにする", + "{name} is uninstalled, but its folder stayed: a copy of its saves couldn't be made first. It's in {path}.": "{name} をアンインストールしましたが、フォルダーは残っています。先にセーブデータのコピーを作れませんでした。場所は {path} です。", + "A copy of its saves is kept. Install it again and put them back from its Saves tab.": "セーブデータのコピーを残しました。もう一度インストールして、「セーブデータ」タブから戻してください。", + "{path}. A copy of its saves is kept first.": "{path}。先にセーブデータのコピーを残します。", + "Delete its folder and its saves": "フォルダーとセーブデータを削除", "N/A": "該当なし" } diff --git a/ui/i18n/ko.json b/ui/i18n/ko.json index 92f8d9fb..beba9a4f 100644 --- a/ui/i18n/ko.json +++ b/ui/i18n/ko.json @@ -3361,5 +3361,14 @@ "Every installed game takes a new release as soon as the launcher finds one": "설치된 모든 게임은 런처가 새 릴리스를 찾으면 바로 받습니다", "Turn off automatic updates": "자동 업데이트 끄기", "Updates wait for you in Downloads": "업데이트는 다운로드에서 기다립니다", + "Setup needs at least 1 GB free on the game's drive. Free some up, or move the game to another drive, then try again.": "셋업하려면 게임 드라이브에 여유 공간이 1GB 이상 있어야 합니다. 공간을 확보하거나 게임을 다른 드라이브로 옮긴 뒤 다시 시도하세요.", + "The game's folder has a .recomplauncher-tmp folder the launcher didn't make, so setup won't use it. Move it out of the game's folder, then try again.": "게임 폴더에 런처가 만들지 않은 .recomplauncher-tmp 폴더가 있어 셋업에서 사용하지 않습니다. 게임 폴더 밖으로 옮긴 뒤 다시 시도하세요.", + "Couldn't make a temp folder for setup in the game's folder. Check the drive isn't full or read-only, then try again.": "게임 폴더에 셋업용 임시 폴더를 만들지 못했습니다. 드라이브가 가득 찼거나 읽기 전용이 아닌지 확인한 뒤 다시 시도하세요.", + "A path in the game's folder is too long for Windows. Add a library folder with a shorter path in Settings → Games and Folders and move the game there, or turn on Windows' long paths setting (LongPathsEnabled), then try again. The launcher doesn't change that setting for you.": "게임 폴더 안의 경로가 Windows에서 쓰기에 너무 깁니다. 설정 → 게임 및 폴더에서 경로가 더 짧은 라이브러리 폴더를 추가하고 게임을 그곳으로 옮기거나, Windows의 긴 경로 설정(LongPathsEnabled)을 켠 뒤 다시 시도하세요. 런처는 이 설정을 대신 바꾸지 않습니다.", + "Keep a copy of its saves first, to put back if you install it again": "먼저 저장 데이터 사본을 남겨 다시 설치하면 되돌릴 수 있게 하기", + "{name} is uninstalled, but its folder stayed: a copy of its saves couldn't be made first. It's in {path}.": "{name}을(를) 제거했지만 폴더는 남아 있습니다. 먼저 저장 데이터 사본을 만들지 못했습니다. 위치: {path}.", + "A copy of its saves is kept. Install it again and put them back from its Saves tab.": "저장 데이터 사본을 남겼습니다. 다시 설치한 뒤 저장 데이터 탭에서 되돌리세요.", + "{path}. A copy of its saves is kept first.": "{path}. 먼저 저장 데이터 사본을 남깁니다.", + "Delete its folder and its saves": "폴더와 저장 데이터 삭제", "N/A": "해당 없음" } diff --git a/ui/i18n/nl.json b/ui/i18n/nl.json index 3f2aa464..c5b47f8a 100644 --- a/ui/i18n/nl.json +++ b/ui/i18n/nl.json @@ -3361,5 +3361,14 @@ "Every installed game takes a new release as soon as the launcher finds one": "Elke geïnstalleerde game krijgt een nieuwe release zodra de launcher die vindt", "Turn off automatic updates": "Automatische updates uitzetten", "Updates wait for you in Downloads": "Updates wachten op je bij Downloads", + "Setup needs at least 1 GB free on the game's drive. Free some up, or move the game to another drive, then try again.": "Instellen heeft minstens 1 GB vrije ruimte nodig op de schijf van de game. Maak wat ruimte vrij of verplaats de game naar een andere schijf en probeer het dan opnieuw.", + "The game's folder has a .recomplauncher-tmp folder the launcher didn't make, so setup won't use it. Move it out of the game's folder, then try again.": "De map van de game bevat een map .recomplauncher-tmp die de launcher niet heeft gemaakt, dus instellen gebruikt die niet. Haal hem uit de map van de game en probeer het dan opnieuw.", + "Couldn't make a temp folder for setup in the game's folder. Check the drive isn't full or read-only, then try again.": "Kon in de map van de game geen tijdelijke map voor het instellen maken. Controleer of de schijf niet vol of alleen-lezen is en probeer het dan opnieuw.", + "A path in the game's folder is too long for Windows. Add a library folder with a shorter path in Settings → Games and Folders and move the game there, or turn on Windows' long paths setting (LongPathsEnabled), then try again. The launcher doesn't change that setting for you.": "Een pad in de map van de game is te lang voor Windows. Voeg in Instellingen → Games en mappen een bibliotheekmap met een korter pad toe en verplaats de game daarheen, of zet de Windows-instelling voor lange paden (LongPathsEnabled) aan en probeer het dan opnieuw. De launcher verandert die instelling niet voor je.", + "Keep a copy of its saves first, to put back if you install it again": "Eerst een kopie van de opgeslagen games bewaren, om terug te zetten als je hem opnieuw installeert", + "{name} is uninstalled, but its folder stayed: a copy of its saves couldn't be made first. It's in {path}.": "{name} is verwijderd, maar de map is gebleven: er kon eerst geen kopie van de opgeslagen games worden gemaakt. Hij staat in {path}.", + "A copy of its saves is kept. Install it again and put them back from its Saves tab.": "Er is een kopie van de opgeslagen games bewaard. Installeer hem opnieuw en zet ze terug via het tabblad Opgeslagen games.", + "{path}. A copy of its saves is kept first.": "{path}. Er wordt eerst een kopie van de opgeslagen games bewaard.", + "Delete its folder and its saves": "De map en de opgeslagen games wissen", "N/A": "n.v.t." } diff --git a/ui/i18n/pl.json b/ui/i18n/pl.json index 933ed9fb..df33e4d5 100644 --- a/ui/i18n/pl.json +++ b/ui/i18n/pl.json @@ -3361,5 +3361,14 @@ "Every installed game takes a new release as soon as the launcher finds one": "Każda zainstalowana gra dostaje nowe wydanie, gdy tylko launcher je znajdzie", "Turn off automatic updates": "Wyłącz automatyczne aktualizacje", "Updates wait for you in Downloads": "Aktualizacje czekają na ciebie w Pobieraniu", + "Setup needs at least 1 GB free on the game's drive. Free some up, or move the game to another drive, then try again.": "Konfiguracja wymaga co najmniej 1 GB wolnego miejsca na dysku gry. Zwolnij trochę miejsca albo przenieś grę na inny dysk i spróbuj ponownie.", + "The game's folder has a .recomplauncher-tmp folder the launcher didn't make, so setup won't use it. Move it out of the game's folder, then try again.": "W folderze gry jest folder .recomplauncher-tmp, którego nie utworzył launcher, więc konfiguracja go nie użyje. Przenieś go poza folder gry i spróbuj ponownie.", + "Couldn't make a temp folder for setup in the game's folder. Check the drive isn't full or read-only, then try again.": "Nie udało się utworzyć folderu tymczasowego dla konfiguracji w folderze gry. Sprawdź, czy dysk nie jest pełny ani tylko do odczytu, i spróbuj ponownie.", + "A path in the game's folder is too long for Windows. Add a library folder with a shorter path in Settings → Games and Folders and move the game there, or turn on Windows' long paths setting (LongPathsEnabled), then try again. The launcher doesn't change that setting for you.": "Ścieżka w folderze gry jest za długa dla Windows. Dodaj folder biblioteki z krótszą ścieżką w Ustawienia → Gry i foldery i przenieś tam grę albo włącz ustawienie długich ścieżek w Windows (LongPathsEnabled) i spróbuj ponownie. Launcher nie zmienia tego ustawienia za ciebie.", + "Keep a copy of its saves first, to put back if you install it again": "Najpierw zachowaj kopię zapisów, by przywrócić je po ponownej instalacji", + "{name} is uninstalled, but its folder stayed: a copy of its saves couldn't be made first. It's in {path}.": "{name} odinstalowano, ale jej folder został: nie udało się najpierw zrobić kopii zapisów. Jest w {path}.", + "A copy of its saves is kept. Install it again and put them back from its Saves tab.": "Kopia zapisów została zachowana. Zainstaluj grę ponownie i przywróć je na karcie Zapisy.", + "{path}. A copy of its saves is kept first.": "{path}. Najpierw zostanie zachowana kopia zapisów.", + "Delete its folder and its saves": "Usuń folder i zapisy", "N/A": "nd." } diff --git a/ui/i18n/pt-BR.json b/ui/i18n/pt-BR.json index eb194277..57106168 100644 --- a/ui/i18n/pt-BR.json +++ b/ui/i18n/pt-BR.json @@ -3361,5 +3361,14 @@ "Every installed game takes a new release as soon as the launcher finds one": "Cada jogo instalado recebe uma versão nova assim que o launcher a encontra", "Turn off automatic updates": "Desativar as atualizações automáticas", "Updates wait for you in Downloads": "As atualizações esperam por você em Downloads", + "Setup needs at least 1 GB free on the game's drive. Free some up, or move the game to another drive, then try again.": "A configuração precisa de pelo menos 1 GB livre na unidade do jogo. Libere um pouco de espaço ou mova o jogo para outra unidade e tente de novo.", + "The game's folder has a .recomplauncher-tmp folder the launcher didn't make, so setup won't use it. Move it out of the game's folder, then try again.": "A pasta do jogo tem uma pasta .recomplauncher-tmp que não foi criada pelo launcher, então a configuração não vai usá-la. Tire-a da pasta do jogo e tente de novo.", + "Couldn't make a temp folder for setup in the game's folder. Check the drive isn't full or read-only, then try again.": "Não foi possível criar uma pasta temporária para a configuração na pasta do jogo. Verifique se a unidade não está cheia nem somente leitura e tente de novo.", + "A path in the game's folder is too long for Windows. Add a library folder with a shorter path in Settings → Games and Folders and move the game there, or turn on Windows' long paths setting (LongPathsEnabled), then try again. The launcher doesn't change that setting for you.": "Um caminho na pasta do jogo é longo demais para o Windows. Adicione uma pasta da biblioteca com um caminho mais curto em Configurações → Jogos e pastas e mova o jogo para lá, ou ative a configuração de caminhos longos do Windows (LongPathsEnabled) e tente de novo. O launcher não muda essa configuração por você.", + "Keep a copy of its saves first, to put back if you install it again": "Guardar antes uma cópia dos dados salvos, para restaurar se você instalar de novo", + "{name} is uninstalled, but its folder stayed: a copy of its saves couldn't be made first. It's in {path}.": "{name} foi desinstalado, mas a pasta dele ficou: não foi possível fazer antes uma cópia dos dados salvos. Ela está em {path}.", + "A copy of its saves is kept. Install it again and put them back from its Saves tab.": "Uma cópia dos dados salvos fica guardada. Instale de novo e restaure pela aba Dados salvos.", + "{path}. A copy of its saves is kept first.": "{path}. Antes, uma cópia dos dados salvos fica guardada.", + "Delete its folder and its saves": "Apagar a pasta e os dados salvos", "N/A": "N/D" } diff --git a/ui/i18n/pt.json b/ui/i18n/pt.json index 54c78f94..012a51da 100644 --- a/ui/i18n/pt.json +++ b/ui/i18n/pt.json @@ -3361,5 +3361,14 @@ "Every installed game takes a new release as soon as the launcher finds one": "Cada jogo instalado recebe uma versão nova assim que o launcher a encontra", "Turn off automatic updates": "Desativar as atualizações automáticas", "Updates wait for you in Downloads": "As atualizações esperam por ti em Transferências", + "Setup needs at least 1 GB free on the game's drive. Free some up, or move the game to another drive, then try again.": "A configuração precisa de pelo menos 1 GB livre na unidade do jogo. Liberta algum espaço ou move o jogo para outra unidade e tenta de novo.", + "The game's folder has a .recomplauncher-tmp folder the launcher didn't make, so setup won't use it. Move it out of the game's folder, then try again.": "A pasta do jogo tem uma pasta .recomplauncher-tmp que não foi criada pelo launcher, por isso a configuração não a usa. Tira-a da pasta do jogo e tenta de novo.", + "Couldn't make a temp folder for setup in the game's folder. Check the drive isn't full or read-only, then try again.": "Não foi possível criar uma pasta temporária para a configuração na pasta do jogo. Verifica se a unidade não está cheia nem só de leitura e tenta de novo.", + "A path in the game's folder is too long for Windows. Add a library folder with a shorter path in Settings → Games and Folders and move the game there, or turn on Windows' long paths setting (LongPathsEnabled), then try again. The launcher doesn't change that setting for you.": "Um caminho na pasta do jogo é demasiado longo para o Windows. Adiciona uma pasta da biblioteca com um caminho mais curto em Definições → Jogos e pastas e move o jogo para lá, ou ativa a definição de caminhos longos do Windows (LongPathsEnabled) e tenta de novo. O launcher não muda essa definição por ti.", + "Keep a copy of its saves first, to put back if you install it again": "Guardar primeiro uma cópia dos dados guardados, para repor se o voltares a instalar", + "{name} is uninstalled, but its folder stayed: a copy of its saves couldn't be made first. It's in {path}.": "{name} foi desinstalado, mas a pasta ficou: não foi possível fazer antes uma cópia dos dados guardados. Está em {path}.", + "A copy of its saves is kept. Install it again and put them back from its Saves tab.": "Fica guardada uma cópia dos dados guardados. Volta a instalá-lo e repõe-nos no separador Dados guardados.", + "{path}. A copy of its saves is kept first.": "{path}. Antes fica guardada uma cópia dos dados guardados.", + "Delete its folder and its saves": "Apagar a pasta e os dados guardados", "N/A": "N/D" } diff --git a/ui/i18n/ru.json b/ui/i18n/ru.json index 34cee555..34fcc723 100644 --- a/ui/i18n/ru.json +++ b/ui/i18n/ru.json @@ -3361,5 +3361,14 @@ "Every installed game takes a new release as soon as the launcher finds one": "Каждая установленная игра получает новый релиз, как только лаунчер его находит", "Turn off automatic updates": "Выключить автообновления", "Updates wait for you in Downloads": "Обновления ждут вас в «Загрузках»", + "Setup needs at least 1 GB free on the game's drive. Free some up, or move the game to another drive, then try again.": "Для настройки на диске игры должно быть свободно не меньше 1 ГБ. Освободите немного места или перенесите игру на другой диск и попробуйте снова.", + "The game's folder has a .recomplauncher-tmp folder the launcher didn't make, so setup won't use it. Move it out of the game's folder, then try again.": "В папке игры есть папка .recomplauncher-tmp, которую создал не лаунчер, поэтому настройка её не использует. Уберите её из папки игры и попробуйте снова.", + "Couldn't make a temp folder for setup in the game's folder. Check the drive isn't full or read-only, then try again.": "Не удалось создать временную папку для настройки в папке игры. Проверьте, что диск не заполнен и не доступен только для чтения, и попробуйте снова.", + "A path in the game's folder is too long for Windows. Add a library folder with a shorter path in Settings → Games and Folders and move the game there, or turn on Windows' long paths setting (LongPathsEnabled), then try again. The launcher doesn't change that setting for you.": "Путь в папке игры слишком длинный для Windows. Добавьте папку библиотеки с более коротким путём в разделе Настройки → Игры и папки и перенесите туда игру или включите в Windows параметр длинных путей (LongPathsEnabled) и попробуйте снова. Лаунчер сам этот параметр не меняет.", + "Keep a copy of its saves first, to put back if you install it again": "Сначала сохранить копию сохранений, чтобы вернуть их после повторной установки", + "{name} is uninstalled, but its folder stayed: a copy of its saves couldn't be made first. It's in {path}.": "{name} удалена, но её папка осталась: сначала не удалось сделать копию сохранений. Она в {path}.", + "A copy of its saves is kept. Install it again and put them back from its Saves tab.": "Копия сохранений сохранена. Установите игру снова и верните их на вкладке «Сохранения».", + "{path}. A copy of its saves is kept first.": "{path}. Сначала будет сделана копия сохранений.", + "Delete its folder and its saves": "Удалить папку вместе с сохранениями", "N/A": "Н/Д" } diff --git a/ui/i18n/th.json b/ui/i18n/th.json index d1f01183..de93974e 100644 --- a/ui/i18n/th.json +++ b/ui/i18n/th.json @@ -3361,5 +3361,14 @@ "Every installed game takes a new release as soon as the launcher finds one": "ทุกเกมที่ติดตั้งไว้จะได้รับรุ่นใหม่ทันทีที่ตัวเปิดเกมพบ", "Turn off automatic updates": "ปิดการอัปเดตอัตโนมัติ", "Updates wait for you in Downloads": "อัปเดตจะรอคุณอยู่ในดาวน์โหลด", + "Setup needs at least 1 GB free on the game's drive. Free some up, or move the game to another drive, then try again.": "การตั้งค่าต้องมีพื้นที่ว่างอย่างน้อย 1 GB ในไดรฟ์ของเกม เคลียร์พื้นที่บางส่วนหรือย้ายเกมไปไดรฟ์อื่น แล้วลองอีกครั้ง", + "The game's folder has a .recomplauncher-tmp folder the launcher didn't make, so setup won't use it. Move it out of the game's folder, then try again.": "โฟลเดอร์ของเกมมีโฟลเดอร์ .recomplauncher-tmp ที่ตัวเปิดเกมไม่ได้สร้าง การตั้งค่าจึงจะไม่ใช้มัน ย้ายมันออกจากโฟลเดอร์ของเกม แล้วลองอีกครั้ง", + "Couldn't make a temp folder for setup in the game's folder. Check the drive isn't full or read-only, then try again.": "สร้างโฟลเดอร์ชั่วคราวสำหรับการตั้งค่าในโฟลเดอร์ของเกมไม่ได้ ตรวจสอบว่าไดรฟ์ไม่เต็มหรือไม่ได้เป็นแบบอ่านอย่างเดียว แล้วลองอีกครั้ง", + "A path in the game's folder is too long for Windows. Add a library folder with a shorter path in Settings → Games and Folders and move the game there, or turn on Windows' long paths setting (LongPathsEnabled), then try again. The launcher doesn't change that setting for you.": "พาธในโฟลเดอร์ของเกมยาวเกินไปสำหรับ Windows เพิ่มโฟลเดอร์คลังที่มีพาธสั้นกว่าใน การตั้งค่า → เกมและโฟลเดอร์ แล้วย้ายเกมไปที่นั่น หรือเปิดการตั้งค่าพาธยาวของ Windows (LongPathsEnabled) แล้วลองอีกครั้ง ตัวเปิดเกมจะไม่เปลี่ยนการตั้งค่านั้นให้คุณ", + "Keep a copy of its saves first, to put back if you install it again": "เก็บสำเนาเซฟไว้ก่อน เพื่อใส่กลับถ้าคุณติดตั้งใหม่", + "{name} is uninstalled, but its folder stayed: a copy of its saves couldn't be made first. It's in {path}.": "ถอนการติดตั้ง {name} แล้ว แต่โฟลเดอร์ยังอยู่: ทำสำเนาเซฟไว้ก่อนไม่ได้ โฟลเดอร์อยู่ที่ {path}", + "A copy of its saves is kept. Install it again and put them back from its Saves tab.": "เก็บสำเนาเซฟไว้แล้ว ติดตั้งเกมใหม่แล้วใส่เซฟกลับจากแท็บเซฟ", + "{path}. A copy of its saves is kept first.": "{path} จะเก็บสำเนาเซฟไว้ก่อน", + "Delete its folder and its saves": "ลบโฟลเดอร์และเซฟ", "N/A": "ไม่มี" } diff --git a/ui/i18n/tr.json b/ui/i18n/tr.json index 2ba4ab83..e40f38ad 100644 --- a/ui/i18n/tr.json +++ b/ui/i18n/tr.json @@ -3361,5 +3361,14 @@ "Every installed game takes a new release as soon as the launcher finds one": "Yüklü her oyun, başlatıcı yeni bir sürüm bulur bulmaz onu alır", "Turn off automatic updates": "Otomatik güncellemeleri kapat", "Updates wait for you in Downloads": "Güncellemeler İndirmeler’de sizi bekler", + "Setup needs at least 1 GB free on the game's drive. Free some up, or move the game to another drive, then try again.": "Kurulum için oyunun sürücüsünde en az 1 GB boş alan gerekiyor. Biraz yer açın ya da oyunu başka bir sürücüye taşıyın, sonra yeniden deneyin.", + "The game's folder has a .recomplauncher-tmp folder the launcher didn't make, so setup won't use it. Move it out of the game's folder, then try again.": "Oyunun klasöründe başlatıcının oluşturmadığı bir .recomplauncher-tmp klasörü var, bu yüzden kurulum onu kullanmıyor. Onu oyunun klasöründen çıkarın, sonra yeniden deneyin.", + "Couldn't make a temp folder for setup in the game's folder. Check the drive isn't full or read-only, then try again.": "Oyunun klasöründe kurulum için geçici bir klasör oluşturulamadı. Sürücünün dolu ya da salt okunur olmadığını kontrol edin, sonra yeniden deneyin.", + "A path in the game's folder is too long for Windows. Add a library folder with a shorter path in Settings → Games and Folders and move the game there, or turn on Windows' long paths setting (LongPathsEnabled), then try again. The launcher doesn't change that setting for you.": "Oyunun klasöründeki bir yol Windows için fazla uzun. Ayarlar → Oyunlar ve klasörler bölümünden daha kısa yollu bir kitaplık klasörü ekleyip oyunu oraya taşıyın ya da Windows'un uzun yollar ayarını (LongPathsEnabled) açın, sonra yeniden deneyin. Başlatıcı bu ayarı sizin yerinize değiştirmez.", + "Keep a copy of its saves first, to put back if you install it again": "Önce kayıtlarının bir kopyası saklansın, oyunu yeniden yüklerseniz geri koymak için", + "{name} is uninstalled, but its folder stayed: a copy of its saves couldn't be made first. It's in {path}.": "{name} kaldırıldı ama klasörü duruyor: önce kayıtlarının bir kopyası alınamadı. Klasör {path} içinde.", + "A copy of its saves is kept. Install it again and put them back from its Saves tab.": "Kayıtlarının bir kopyası saklandı. Oyunu yeniden yükleyin ve Kayıtlar sekmesinden geri koyun.", + "{path}. A copy of its saves is kept first.": "{path}. Önce kayıtlarının bir kopyası saklanır.", + "Delete its folder and its saves": "Klasörünü ve kayıtlarını sil", "N/A": "Yok" } diff --git a/ui/i18n/uk.json b/ui/i18n/uk.json index 47e84bd8..278ae507 100644 --- a/ui/i18n/uk.json +++ b/ui/i18n/uk.json @@ -3361,5 +3361,14 @@ "Every installed game takes a new release as soon as the launcher finds one": "Кожна встановлена гра отримує новий реліз, щойно лаунчер його знаходить", "Turn off automatic updates": "Вимкнути автооновлення", "Updates wait for you in Downloads": "Оновлення чекають на тебе в «Завантаженнях»", + "Setup needs at least 1 GB free on the game's drive. Free some up, or move the game to another drive, then try again.": "Для налаштування на диску гри має бути вільно щонайменше 1 ГБ. Звільни трохи місця або перенеси гру на інший диск і спробуй ще раз.", + "The game's folder has a .recomplauncher-tmp folder the launcher didn't make, so setup won't use it. Move it out of the game's folder, then try again.": "У папці гри є папка .recomplauncher-tmp, яку створив не лаунчер, тому налаштування її не використовує. Прибери її з папки гри і спробуй ще раз.", + "Couldn't make a temp folder for setup in the game's folder. Check the drive isn't full or read-only, then try again.": "Не вдалося створити тимчасову папку для налаштування в папці гри. Перевір, що диск не заповнений і не лише для читання, і спробуй ще раз.", + "A path in the game's folder is too long for Windows. Add a library folder with a shorter path in Settings → Games and Folders and move the game there, or turn on Windows' long paths setting (LongPathsEnabled), then try again. The launcher doesn't change that setting for you.": "Шлях у папці гри задовгий для Windows. Додай папку бібліотеки з коротшим шляхом у Налаштування → Ігри та папки й перенеси туди гру або ввімкни в Windows параметр довгих шляхів (LongPathsEnabled) і спробуй ще раз. Лаунчер сам цей параметр не змінює.", + "Keep a copy of its saves first, to put back if you install it again": "Спершу зберегти копію збережень, щоб повернути їх після повторного встановлення", + "{name} is uninstalled, but its folder stayed: a copy of its saves couldn't be made first. It's in {path}.": "{name} видалено, але її папка лишилася: спершу не вдалося зробити копію збережень. Вона в {path}.", + "A copy of its saves is kept. Install it again and put them back from its Saves tab.": "Копію збережень збережено. Встанови гру знову й поверни їх на вкладці «Збереження».", + "{path}. A copy of its saves is kept first.": "{path}. Спершу буде зроблено копію збережень.", + "Delete its folder and its saves": "Видалити папку разом зі збереженнями", "N/A": "Н/Д" } diff --git a/ui/i18n/vi.json b/ui/i18n/vi.json index 111d802b..42ac9704 100644 --- a/ui/i18n/vi.json +++ b/ui/i18n/vi.json @@ -3361,5 +3361,14 @@ "Every installed game takes a new release as soon as the launcher finds one": "Mỗi game đã cài nhận bản phát hành mới ngay khi trình khởi chạy tìm thấy", "Turn off automatic updates": "Tắt tự động cập nhật", "Updates wait for you in Downloads": "Bản cập nhật chờ bạn trong Tải xuống", + "Setup needs at least 1 GB free on the game's drive. Free some up, or move the game to another drive, then try again.": "Thiết lập cần ít nhất 1 GB trống trên ổ của trò chơi. Hãy giải phóng bớt dung lượng hoặc chuyển trò chơi sang ổ khác, rồi thử lại.", + "The game's folder has a .recomplauncher-tmp folder the launcher didn't make, so setup won't use it. Move it out of the game's folder, then try again.": "Thư mục trò chơi có một thư mục .recomplauncher-tmp không do trình khởi chạy tạo, nên thiết lập sẽ không dùng nó. Hãy chuyển nó ra khỏi thư mục trò chơi, rồi thử lại.", + "Couldn't make a temp folder for setup in the game's folder. Check the drive isn't full or read-only, then try again.": "Không tạo được thư mục tạm cho thiết lập trong thư mục trò chơi. Hãy kiểm tra ổ đĩa không bị đầy hoặc chỉ đọc, rồi thử lại.", + "A path in the game's folder is too long for Windows. Add a library folder with a shorter path in Settings → Games and Folders and move the game there, or turn on Windows' long paths setting (LongPathsEnabled), then try again. The launcher doesn't change that setting for you.": "Một đường dẫn trong thư mục trò chơi quá dài đối với Windows. Hãy thêm một thư mục thư viện có đường dẫn ngắn hơn trong Cài đặt → Trò chơi và thư mục rồi chuyển trò chơi sang đó, hoặc bật cài đặt đường dẫn dài của Windows (LongPathsEnabled), rồi thử lại. Trình khởi chạy không tự thay đổi cài đặt đó cho bạn.", + "Keep a copy of its saves first, to put back if you install it again": "Giữ trước một bản sao dữ liệu lưu, để khôi phục nếu bạn cài lại", + "{name} is uninstalled, but its folder stayed: a copy of its saves couldn't be made first. It's in {path}.": "Đã gỡ {name}, nhưng thư mục của nó vẫn còn: không tạo được bản sao dữ liệu lưu trước. Nó nằm ở {path}.", + "A copy of its saves is kept. Install it again and put them back from its Saves tab.": "Đã giữ một bản sao dữ liệu lưu. Hãy cài lại trò chơi và khôi phục từ thẻ Dữ liệu lưu.", + "{path}. A copy of its saves is kept first.": "{path}. Một bản sao dữ liệu lưu sẽ được giữ trước.", + "Delete its folder and its saves": "Xóa thư mục và dữ liệu lưu", "N/A": "Không có" } diff --git a/ui/i18n/zh-Hans.json b/ui/i18n/zh-Hans.json index fa7497f5..5e7868fb 100644 --- a/ui/i18n/zh-Hans.json +++ b/ui/i18n/zh-Hans.json @@ -3361,5 +3361,14 @@ "Every installed game takes a new release as soon as the launcher finds one": "启动器一发现新版本,所有已安装的游戏就会立即更新", "Turn off automatic updates": "关闭自动更新", "Updates wait for you in Downloads": "更新会在“下载”中等你", + "Setup needs at least 1 GB free on the game's drive. Free some up, or move the game to another drive, then try again.": "配置需要游戏所在驱动器至少有 1 GB 可用空间。请腾出一些空间,或把游戏移到其他驱动器,然后重试。", + "The game's folder has a .recomplauncher-tmp folder the launcher didn't make, so setup won't use it. Move it out of the game's folder, then try again.": "游戏文件夹里有一个不是启动器创建的 .recomplauncher-tmp 文件夹,所以配置不会使用它。请把它移出游戏文件夹,然后重试。", + "Couldn't make a temp folder for setup in the game's folder. Check the drive isn't full or read-only, then try again.": "无法在游戏文件夹中为配置创建临时文件夹。请检查驱动器是否已满或为只读,然后重试。", + "A path in the game's folder is too long for Windows. Add a library folder with a shorter path in Settings → Games and Folders and move the game there, or turn on Windows' long paths setting (LongPathsEnabled), then try again. The launcher doesn't change that setting for you.": "游戏文件夹中的某个路径对 Windows 来说太长。请在“设置”→“游戏和文件夹”中添加一个路径更短的游戏库文件夹并把游戏移过去,或打开 Windows 的长路径设置(LongPathsEnabled),然后重试。启动器不会替你更改这个设置。", + "Keep a copy of its saves first, to put back if you install it again": "先保留一份存档副本,重新安装后可以放回", + "{name} is uninstalled, but its folder stayed: a copy of its saves couldn't be made first. It's in {path}.": "{name} 已卸载,但它的文件夹还在:无法先做一份存档副本。它位于 {path}。", + "A copy of its saves is kept. Install it again and put them back from its Saves tab.": "已保留一份存档副本。重新安装后,可在“存档”选项卡中放回。", + "{path}. A copy of its saves is kept first.": "{path}。会先保留一份存档副本。", + "Delete its folder and its saves": "删除其文件夹和存档", "N/A": "不适用" } diff --git a/ui/i18n/zh-Hant.json b/ui/i18n/zh-Hant.json index 0f67ff85..fe3a1885 100644 --- a/ui/i18n/zh-Hant.json +++ b/ui/i18n/zh-Hant.json @@ -3361,5 +3361,14 @@ "Every installed game takes a new release as soon as the launcher finds one": "啟動器一找到新版本,所有已安裝的遊戲就會立即更新", "Turn off automatic updates": "關閉自動更新", "Updates wait for you in Downloads": "更新會在「下載」中等您", + "Setup needs at least 1 GB free on the game's drive. Free some up, or move the game to another drive, then try again.": "設定需要遊戲所在的磁碟機至少有 1 GB 可用空間。請騰出一些空間,或把遊戲移到其他磁碟機,然後再試一次。", + "The game's folder has a .recomplauncher-tmp folder the launcher didn't make, so setup won't use it. Move it out of the game's folder, then try again.": "遊戲資料夾裡有一個不是啟動器建立的 .recomplauncher-tmp 資料夾,所以設定不會使用它。請把它移出遊戲資料夾,然後再試一次。", + "Couldn't make a temp folder for setup in the game's folder. Check the drive isn't full or read-only, then try again.": "無法在遊戲資料夾中為設定建立暫存資料夾。請檢查磁碟機是否已滿或為唯讀,然後再試一次。", + "A path in the game's folder is too long for Windows. Add a library folder with a shorter path in Settings → Games and Folders and move the game there, or turn on Windows' long paths setting (LongPathsEnabled), then try again. The launcher doesn't change that setting for you.": "遊戲資料夾中的某個路徑對 Windows 來說太長。請在「設定」→「遊戲和資料夾」中新增一個路徑較短的遊戲庫資料夾並把遊戲移過去,或開啟 Windows 的長路徑設定(LongPathsEnabled),然後再試一次。啟動器不會替你變更這個設定。", + "Keep a copy of its saves first, to put back if you install it again": "先保留一份存檔副本,重新安裝後可以放回", + "{name} is uninstalled, but its folder stayed: a copy of its saves couldn't be made first. It's in {path}.": "{name} 已解除安裝,但它的資料夾還在:無法先做一份存檔副本。它位於 {path}。", + "A copy of its saves is kept. Install it again and put them back from its Saves tab.": "已保留一份存檔副本。重新安裝後,可在「存檔」分頁中放回。", + "{path}. A copy of its saves is kept first.": "{path}。會先保留一份存檔副本。", + "Delete its folder and its saves": "刪除其資料夾和存檔", "N/A": "不適用" } diff --git a/ui/tv.js b/ui/tv.js index dc09c501..ec282722 100644 --- a/ui/tv.js +++ b/ui/tv.js @@ -1882,9 +1882,11 @@ const g = S.library[id]; if (!g) return; if (S.running.has(id)) return toast(t('Close the game first.'), true); - const run = (del) => async () => { + // keep: a copy of its saves first, as the desktop's tick does (on unless the player picks the + // item that deletes them too). + const run = (del, keep = true) => async () => { let r = {}; - try { r = (await invoke('uninstall', { id, deleteFiles: del })) || {}; } catch (e) { await refreshState(); draw(true); return fail(e); } + try { r = (await invoke('uninstall', { id, deleteFiles: del, keepSaves: keep })) || {}; } catch (e) { await refreshState(); draw(true); return fail(e); } if (window.usageUninstall) window.usageUninstall(id); if (window.keepOut) await window.keepOut(id); delete S.updates[id]; @@ -1892,15 +1894,18 @@ await refreshState(); render(true); if (r.left) toast(tf('{name} is uninstalled, but a few of its files are still in use and stayed in {path}. Close whatever is using them (or restart), then delete that folder.', { name: g.name, path: r.path }), true); + else if (del && r.kept && r.saves_stuck) toast(tf('{name} is uninstalled, but its folder stayed: a copy of its saves couldn\'t be made first. It\'s in {path}.', { name: g.name, path: r.path }), true); else if (r.uninstaller) toast(tf('{name} is uninstalled. Its own uninstaller is open to remove the game from where it installed it.', { name: g.name })); else toast(tf('{name} is uninstalled.', { name: g.name })); + if (r.saves_kept) toast(t('A copy of its saves is kept. Install it again and put them back from its Saves tab.')); draw(true); }; const own = ownFolder(g); sheet(tf('Uninstall {name}?', { name: g.name }), [ { label: t('Keep it'), sub: t('Nothing changes'), icon: 'chevL', run: () => {} }, ...(own - ? [{ label: t('Uninstall and delete its folder'), sub: tf('{path}, with the saves and settings inside it', { path: g.path }), icon: 'bin', cls: 'danger', run: run(true) }, + ? [{ label: t('Uninstall and delete its folder'), sub: tf('{path}. A copy of its saves is kept first.', { path: g.path }), icon: 'bin', cls: 'danger', run: run(true) }, + { label: t('Delete its folder and its saves'), sub: tf('{path}, with the saves and settings inside it', { path: g.path }), icon: 'bin', cls: 'danger', run: run(true, false) }, { label: t('Uninstall, keep its folder'), sub: t('It comes out of your Library and its files stay'), icon: 'folder', run: run(false) }] : [{ label: t('Uninstall'), sub: tf('Its folder stays where it is: {path}', { path: g.path }), icon: 'bin', cls: 'danger', run: run(false) }]), ]);