feat(builds): an instance's folder is builds/<track>/<version>, renamed when it updates #184

Open
dyst wants to merge 6 commits from dyst/LongshotLauncher:fix/instance-folder-names into main
Member

A build's folder named after its track (nightly, nightly (2)) looked like a copy of another and said nothing about what was in it, so anyone cleaning up their disk couldn't tell which version was where. Every instance now lives in <builds>/<track>/<version>, and an update renames its folder to the new version.

Stacked on #182 (the stack below it: #181 is merged): merge order #182, #184, then #185. Related: #180 (the home's list is Your instances).

What changed

  • New instances: <builds>/<track>/<version> (LauncherSettings.FolderFor): nightly/nightly-2029-c544828f, stable/v3.0.1. The folder name is the version itself (Versions.IsTagName's characters, safe on Windows and Linux; Longshot for an unknown track or a version with no such name). A second instance of the same version is <version> (2), the only suffix. A new build never goes inside an old instance's folder named after its track (<builds>/nightly (2)/<version> until that one is moved).
  • Update / go-back: the folder is renamed to the new version's name when the build starts, before make_game.py (BuildRegistry.FolderOf, BuildJob.Place, BuildStepViewModel.RenameFolder, InstanceFolders.Rename), so make_game.py's --out/--update is the final path.
    • A rename, not a copy: the game, its settings, shader caches (an in-place update keeps them, ShaderCaches.Keep sees the same folder), mods and a save in its own user/save go with it.
    • The row takes the new folder at once and the list is saved; the new version comes when the build finishes (BuildRegistry.Replace).
    • Fails safe: refused, nothing changed and nothing started, while Longshot runs, onto a path that exists, or on Windows while a file in the folder is held open (File Explorer, an editor, antivirus): the problem page says so and Build again retries.
    • Rolls back: a build that fails, is stopped (Cancel, the launcher's SIGTERM) or can't start renames the folder back (InstanceFolders.MoveBack, waiting up to 10 s for a file the stopped build still holds), so the row's folder names the version the row still has. If it can't go back, the row lists where the folder is and the log says so.
    • A rebuild of the same version keeps its folder as it is.
  • Step 2: "Game folder" is now the Builds folder. Its Change sets Settings' builds folder, one setting, so step 2 and Settings never disagree (the row says so). There's no way to pick a folder for one instance any more (PickedFolder is gone). Under it, where this build goes: Builds into nightly\nightly-…, or for an update/go-back nightly\nightly-189-… becomes nightly\nightly-187-… when the build starts ….
  • Settings: BUILDS FOLDER (was WHERE BUILDS GO) and BUILD FILES each say what they hold: your instances, one folder per track and version; working files every build reuses, not the game, can be on another drive. The build files folder is unchanged otherwise (its own default, its own Change).
  • Instances that already live elsewhere (a folder the player chose before) keep working where they are and are never renamed.
  • The home's offer (Instances in the old folder layout: Keep / Move) now moves the instances from before this layout into it: those named after their track (nightly, nightly (2), launchers rc.7 and on) and those named after their first version (v3.0.0-rc.5, launchers before rc.7). Track-named ones first, since <builds>/nightly becomes the nightly's folder (moved by way of a name beside it, and back the same way). Same safety rules as before, plus: never into another instance's folder. Keep is remembered.
  • Scans: the leftover offer and the saves' gather look in the tracks' folders too (InstanceFolders.Folders).

The trade-off: shortcuts made by hand

The launcher's own shortcuts start --play and keep working. A shortcut or a Steam (non-Steam game) entry made to the game's own program (bin\longshot.exe), common on the Steam Deck, or a Gear Lever entry, points at the old path and has to be made again after an update. Step 2 says so before every update that renames, and so does the README. That's the price of a folder that names its version.

Tests

  • python -I tests/test_launcher_core.py: 1798 checks pass. New InstanceFolderChecks drive the real path in temp folders:
    • first build → nightly/<v1> (make_game's --out is that folder); another version → nightly/<v2>; the same version again → (2);
    • an update renamed to <v3> with save, shader caches, mods and settings inside, the list saved; a go-back renamed down;
    • refusals: Longshot running, a path there, a file held open on Windows (a real FileShare.None lock on this PC) → nothing changed;
    • a failed build → back to the old name, list saved; MoveBack waiting for a held file;
    • a folder of the player's never renamed;
    • the offer for both old shapes, its order, every refusal, a move into its own folder and back, a list that can't be saved.
    • UpdateFolderChecks and FolderFor's vectors are rewritten for the new layout (not weakened); a source check makes sure step 2 picks no folder of its own.
  • python -I tests/test_release.py: OK. dotnet build App -c Release: 0 warnings, 0 errors.
  • Translations: the new texts are in all 12 catalogs, written by an AI: they need a native speaker's check. The replaced ones are removed.

Screenshots

Before/after in #184 (comment) (headless, tools/screenshots).

What to check on a PC with a dump

Not run with a real build here (no game dump on this PC).

  1. Build a nightly: it lands in <builds>\nightly\<version>.
  2. Build another version of the same track: <builds>\nightly\<other version>, no (2).
  3. Play it once (so it has shader caches), then Update it: step 2 says … becomes …; the folder is renamed before the build starts; after it finishes, the save, shader caches (no long "Preparing shaders" at the next start), mods and settings are there.
  4. Go back to an older version: renamed down the same way.
  5. Start an update with a File Explorer window open inside the instance's folder (Windows): the build refuses with a clear message and nothing changes; close it, Build again.
  6. Cancel an update mid-build: the folder is back to its old name.
  7. With an instance from an older launcher (<builds>\nightly or <builds>\v3.0.0-rc.5): the home offers Move; after it, the instance is in <builds>\<track>\<version> and plays.
A build's folder named after its track (`nightly`, `nightly (2)`) looked like a copy of another and said nothing about what was in it, so anyone cleaning up their disk couldn't tell which version was where. Every instance now lives in `<builds>/<track>/<version>`, and an update renames its folder to the new version. **Stacked on #182** (the stack below it: #181 is merged): merge order #182, #184, then #185. Related: #180 (the home's list is *Your instances*). ## What changed - **New instances: `<builds>/<track>/<version>`** (`LauncherSettings.FolderFor`): `nightly/nightly-2029-c544828f`, `stable/v3.0.1`. The folder name is the version itself (Versions.IsTagName's characters, safe on Windows and Linux; `Longshot` for an unknown track or a version with no such name). A second instance of the **same** version is `<version> (2)`, the only suffix. A new build never goes inside an old instance's folder named after its track (`<builds>/nightly (2)/<version>` until that one is moved). - **Update / go-back: the folder is renamed to the new version's name when the build starts, before make_game.py** (`BuildRegistry.FolderOf`, `BuildJob.Place`, `BuildStepViewModel.RenameFolder`, `InstanceFolders.Rename`), so make_game.py's `--out`/`--update` is the final path. - A rename, not a copy: the game, its settings, shader caches (an in-place update keeps them, `ShaderCaches.Keep` sees the same folder), mods and a save in its own `user/save` go with it. - The row takes the new folder at once and the list is saved; the new version comes when the build finishes (`BuildRegistry.Replace`). - **Fails safe:** refused, nothing changed and nothing started, while Longshot runs, onto a path that exists, or on Windows while a file in the folder is held open (File Explorer, an editor, antivirus): the problem page says so and *Build again* retries. - **Rolls back:** a build that fails, is stopped (Cancel, the launcher's SIGTERM) or can't start renames the folder back (`InstanceFolders.MoveBack`, waiting up to 10 s for a file the stopped build still holds), so the row's folder names the version the row still has. If it can't go back, the row lists where the folder is and the log says so. - A rebuild of the same version keeps its folder as it is. - **Step 2: "Game folder" is now the Builds folder.** Its *Change* sets Settings' builds folder, one setting, so step 2 and Settings never disagree (the row says so). There's no way to pick a folder for one instance any more (`PickedFolder` is gone). Under it, where this build goes: *Builds into nightly\nightly-…*, or for an update/go-back *nightly\nightly-189-… becomes nightly\nightly-187-… when the build starts …*. - **Settings:** *BUILDS FOLDER* (was *WHERE BUILDS GO*) and *BUILD FILES* each say what they hold: your instances, one folder per track and version; working files every build reuses, not the game, can be on another drive. The build files folder is unchanged otherwise (its own default, its own Change). - **Instances that already live elsewhere** (a folder the player chose before) keep working where they are and are never renamed. - **The home's offer** (*Instances in the old folder layout*: Keep / Move) now moves the instances from before this layout into it: those named after their track (`nightly`, `nightly (2)`, launchers rc.7 and on) and those named after their first version (`v3.0.0-rc.5`, launchers before rc.7). Track-named ones first, since `<builds>/nightly` becomes the nightly's folder (moved by way of a name beside it, and back the same way). Same safety rules as before, plus: never into another instance's folder. Keep is remembered. - **Scans:** the leftover offer and the saves' gather look in the tracks' folders too (`InstanceFolders.Folders`). ## The trade-off: shortcuts made by hand The launcher's own shortcuts start `--play` and keep working. **A shortcut or a Steam (non-Steam game) entry made to the game's own program (`bin\longshot.exe`), common on the Steam Deck, or a Gear Lever entry, points at the old path and has to be made again after an update.** Step 2 says so before every update that renames, and so does the README. That's the price of a folder that names its version. ## Tests - `python -I tests/test_launcher_core.py`: 1798 checks pass. New `InstanceFolderChecks` drive the real path in temp folders: - first build → `nightly/<v1>` (make_game's `--out` is that folder); another version → `nightly/<v2>`; the same version again → `(2)`; - an update renamed to `<v3>` with save, shader caches, mods and settings inside, the list saved; a go-back renamed down; - refusals: Longshot running, a path there, **a file held open on Windows** (a real `FileShare.None` lock on this PC) → nothing changed; - a failed build → back to the old name, list saved; `MoveBack` waiting for a held file; - a folder of the player's never renamed; - the offer for both old shapes, its order, every refusal, a move into its own folder and back, a list that can't be saved. - `UpdateFolderChecks` and `FolderFor`'s vectors are rewritten for the new layout (not weakened); a source check makes sure step 2 picks no folder of its own. - `python -I tests/test_release.py`: OK. `dotnet build App -c Release`: 0 warnings, 0 errors. - Translations: the new texts are in all 12 catalogs, **written by an AI: they need a native speaker's check**. The replaced ones are removed. ## Screenshots Before/after in https://git.magicbean.dev/MagicBeanDev/LongshotLauncher/pulls/184#issuecomment-45346 (headless, `tools/screenshots`). ## What to check on a PC with a dump Not run with a real build here (no game dump on this PC). 1. Build a nightly: it lands in `<builds>\nightly\<version>`. 2. *Build another version* of the same track: `<builds>\nightly\<other version>`, no `(2)`. 3. Play it once (so it has shader caches), then Update it: step 2 says *… becomes …*; the folder is renamed before the build starts; after it finishes, the save, shader caches (no long "Preparing shaders" at the next start), mods and settings are there. 4. Go back to an older version: renamed down the same way. 5. Start an update with a File Explorer window open inside the instance's folder (Windows): the build refuses with a clear message and nothing changes; close it, *Build again*. 6. Cancel an update mid-build: the folder is back to its old name. 7. With an instance from an older launcher (`<builds>\nightly` or `<builds>\v3.0.0-rc.5`): the home offers *Move*; after it, the instance is in `<builds>\<track>\<version>` and plays.
fix(home): offer to rename instances' folders an old launcher named after a version
All checks were successful
CI / Compile and test (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 4s
b0017b3a2c
Launchers before v1.0.0-rc.7 named a new build's folder after the version it
first built (LauncherSettings.FolderFor took the version until #104), and an
update stays in its build's folder (BuildRegistry.FolderOf), so such an
instance keeps its first version's name after every update. New instances are
already named after their track. The home now offers, once, to rename the old
ones after their track (Keep or Rename, InstanceFolders): only listed
instances in the builds folder, renamed in place so everything in them stays,
refused while Longshot runs, for links and for folders holding the home or the
shared saves, and put back if the list cannot be saved.

Checks drive a new instance through the whole path (the folder chosen,
make_game.py's --out, the row kept, an update, a go-back) and the rename.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Member

Screenshots

The offer is new, so there is no before. Drawn with tools/screenshots (headless, scene home-rename-folders): two instances an older launcher named after a version, Keep or Rename. The existing home-leftovers scene is unchanged.

home-rename-folders.png

## Screenshots The offer is new, so there is no before. Drawn with `tools/screenshots` (headless, scene `home-rename-folders`): two instances an older launcher named after a version, Keep or Rename. The existing `home-leftovers` scene is unchanged. ![home-rename-folders.png](https://git.magicbean.dev/attachments/0baeb0ce-bdb7-457e-a806-0f2ae0c80cfe)
Collaborator

Possibly related, for context:

  • issue #138 Launcher: Updated build folder is not renamed to the current channel name — Open request about version-named folders persisting after updates; this offers a user-directed rename
Possibly related, for context: - issue #138 Launcher: Updated build folder is not renamed to the current channel name — Open request about version-named folders persisting after updates; this offers a user-directed rename
dyst force-pushed fix/instance-folder-names from b0017b3a2c
All checks were successful
CI / Compile and test (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 4s
to 0fc4752372
All checks were successful
CI / Compile and test (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 4s
2026-11-17 21:06:51 +00:00
Compare
Author
Member

Rebased onto #182 so the stack merges in order; only the language files conflicted (both sides kept); builds with 0 errors.

Rebased onto #182 so the stack merges in order; only the language files conflicted (both sides kept); builds with 0 errors.
dyst force-pushed fix/instance-folder-names from 0fc4752372
All checks were successful
CI / Compile and test (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 4s
to 6bd1ab1210
All checks were successful
CI / Compile and test (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 3s
2026-11-17 21:14:21 +00:00
Compare
Author
Member

Rebased onto main (8594b47: #180, #171 and #179 merged). Only the language files and the screenshot tool's scene list conflicted, both sides adding entries; both kept, each catalog checked as JSON with no duplicate key, the app and the screenshot tool build with 0 warnings. The code is otherwise unchanged, so the earlier test runs stand. Merge order: #181, #182, #184, #185.

Rebased onto main (8594b47: #180, #171 and #179 merged). Only the language files and the screenshot tool's scene list conflicted, both sides adding entries; both kept, each catalog checked as JSON with no duplicate key, the app and the screenshot tool build with 0 warnings. The code is otherwise unchanged, so the earlier test runs stand. Merge order: #181, #182, #184, #185.
feat(builds): an instance's folder is builds/<track>/<version>, renamed when it updates
All checks were successful
CI / Compile and test (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 3s
d9f5559815
A folder named after its track (nightly, nightly (2)) looked like a copy of
another and said nothing about what was in it. Every instance now lives in
<builds>/<track>/<version> (nightly/nightly-2029-c544828f, stable/v3.0.1);
a second instance of the same version is "<version> (2)", the only suffix.

An update or a go-back renames its instance's folder to the new version's
name when the build starts, before make_game.py (BuildRegistry.FolderOf,
InstanceFolders.Rename): the same folder, so its game, settings, shader
caches, mods and own save go with it, and the list is saved with it. Refused,
nothing changed and nothing started, while Longshot runs, onto a path that
is there, or on Windows while a file in it is held open; a build that fails
or is stopped renames it back (InstanceFolders.MoveBack, waiting up to 10 s
for a file it still holds). An instance in a folder the player chose before
is never renamed. A shortcut or Steam entry made to the game's own program
points at the old path after an update: step 2 and the README say so.

Step 2's "Game folder" is the Builds folder: its Change sets Settings' builds
folder (one setting, so the two never disagree), and the line under it says
where this build goes, or "<old> becomes <new>". Settings' builds folder and
build files rows say what each holds.

The home's offer now moves the instances from before this layout (named
after their track, or after their first version) into it, the track-named
first, builds/nightly becoming the nightly's folder by way of a name beside
it. The leftovers and the saves' gather look in the tracks' folders too.

Checks drive the path: new builds, the same version again, an update and a
go-back renamed with everything in them, refusals (a file held open on
Windows), a failed build put back, a folder of the player's never renamed,
the offer for both old shapes, and step 2 picking no folder of its own.

Assisted-by: Claude Code
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Author
Member

Screenshots: before and after (the instance-folder rework, d9f5559)

Drawn with tools/screenshots (headless, the same scene and window size on both sides). Before is this PR's previous head, 6bd1ab1.

Settings: the builds folder and the build files

Each row now says what it holds.

before
after

Step 2, a new build

"Game folder" is now the Builds folder, Settings' own setting; the line under it says where this build goes (nightly\nightly-…).

before
after

Step 2, going back to an older nightly

The instance's folder takes that version's name when the build starts, and the line says what follows it.

before
after

The home's offer

Instances in the old layout (named after their track or their first version) move into <builds>/<track>/<version>.

before
after

## Screenshots: before and after (the instance-folder rework, d9f5559) Drawn with `tools/screenshots` (headless, the same scene and window size on both sides). Before is this PR's previous head, 6bd1ab1. ### Settings: the builds folder and the build files Each row now says what it holds. ![before](https://git.magicbean.dev/attachments/765314bc-2b1e-4502-8f24-323703363f2a) ![after](https://git.magicbean.dev/attachments/8fd3dd40-7359-4340-b4d4-5f4e612f6f15) ### Step 2, a new build "Game folder" is now the Builds folder, Settings' own setting; the line under it says where this build goes (`nightly\nightly-…`). ![before](https://git.magicbean.dev/attachments/e85dc211-ff92-493d-96b4-8ff1fd7863e9) ![after](https://git.magicbean.dev/attachments/3ecd5b0c-60e4-4ef8-8a20-fa85e1a59a7e) ### Step 2, going back to an older nightly The instance's folder takes that version's name when the build starts, and the line says what follows it. ![before](https://git.magicbean.dev/attachments/61bba7a5-4ea0-44e4-bc03-09b2e6152cb0) ![after](https://git.magicbean.dev/attachments/ef19a2ae-5b65-4c15-9831-9460df02ac58) ### The home's offer Instances in the old layout (named after their track or their first version) move into `<builds>/<track>/<version>`. ![before](https://git.magicbean.dev/attachments/3ca5f592-52bb-4742-8ccc-20d02f17c674) ![after](https://git.magicbean.dev/attachments/9e29ba40-b602-4ef2-acf7-44c3036212b7)
dyst changed title from fix(home): offer to rename instances' folders an old launcher named after a version to feat(builds): an instance's folder is builds/<track>/<version>, renamed when it updates 2026-11-17 21:47:14 +00:00
Author
Member

Reworked (d9f5559): instances live in //, a second same version is ' (2)', an update or go-back renames its folder before make_game.py and back if the build doesn't finish, step 2's Change sets the builds folder (Settings' own) and shows where the build goes, and the home's offer moves both old shapes into the layout. 1798 checks pass. Description rewritten; screenshots above.

Reworked (d9f5559): instances live in <builds>/<track>/<version>, a second same version is ' (2)', an update or go-back renames its folder before make_game.py and back if the build doesn't finish, step 2's Change sets the builds folder (Settings' own) and shows where the build goes, and the home's offer moves both old shapes into the layout. 1798 checks pass. Description rewritten; screenshots above.
All checks were successful
CI / Compile and test (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 3s
This pull request has changes conflicting with the target branch.
  • App/MainWindow.axaml
  • App/ViewModels/SavesViewModel.cs
  • App/Views/SavesView.axaml
  • App/Views/Views.cs
  • Core/Lang/de.json
  • Core/Lang/es.json
  • Core/Lang/fr.json
  • Core/Lang/it.json
  • Core/Lang/ja.json
  • Core/Lang/ko.json
  • Core/Lang/nl.json
  • Core/Lang/pl.json
  • Core/Lang/pt-BR.json
  • Core/Lang/ru.json
  • Core/Lang/zh-Hans.json
  • Core/Lang/zh-Hant.json
  • README.md
  • docs/saves.md
  • tests/launcher_core/Program.cs
  • tools/screenshots/Program.cs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'fix/instance-folder-names:dyst-fix/instance-folder-names'
git switch 'dyst-fix/instance-folder-names'
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
MagicBeanDev/LongshotLauncher!184
No description provided.