fix(update): game files picked in the folder an update renames are read from its new name #207

Merged
HumanBean merged 2 commits from madebyjordan/LongshotLauncher:fix/update-picked-folders-follow-rename into main 2026-11-19 16:07:04 +00:00
Member

Type: fix · Risk: low · Tested on: Windows 11 Home (26200), .NET SDK 10.0.404: the instance-folder core checks (fail on main, pass here), a build of the App project; no build run in the launcher · Needs: a player who updates with game files picked inside the build's own folder (the reporter is on Linux)

TL;DR

An update renames its build's folder to the new version's name when the build starts (builds/nightly/nightly-483-… to nightly-486-…). If the player picked game files inside that folder (its own romfs and .longshot_exefs, so they don't need the dump again), the launcher still gave make_game.py the old paths. Those were gone, so the build stopped straight away with a misleading message:

The romfs folder /mnt/hp/Games/Ocarina of Time/Longshot/nightly/nightly-483-7daafa7a/romfs does not hold the game's files (no Pack/ZsDic.pack.zs): choose the extracted RomFS.

Now paths inside a renamed folder follow it to its new name. That covers the build's pick, the list's rows and the remembered Last used files.

Why

Reported by abi in Discord #support (2026-11-19, building Nightly 486 over 483): "I've just been pointing at the romfs and exefs from the previous nightly, but after some launcher updates (I think the nightly folder layout changes) it runs into this… think it may be renaming and conflicting with itself". Their workaround is to copy the files out of the folder first.

The order of events at 87b7072:

  1. SettingsStepViewModel.Start remembers the picked romfs and exefs (inside nightly-483-…). BuildStepViewModel.Run then calls RenameFolder before anything else.
  2. InstanceFolders.Rename moves the folder to nightly-486-…. Only the row's Folder follows (BuildRegistry.Moved).
  3. Run builds the request from job.Picked, which still names nightly-483-…/romfs. make_game.py's check_romfs_folder finds nothing there and fails.

This started with the builds/<track>/<version> layout. Before it, an update built in a folder that kept its name, so the same pick worked.

What changed

  • Core/InstanceFolders.cs: Follow(path, from, to). A path inside from, or from itself, maps to the same place under to. Any other path is returned unchanged, including a sibling whose name starts the same (nightly-483-x-other).
  • Core/BuildRegistry.cs: Moved also moves every row's Nup, Romfs and Exefs that were inside the renamed folder. Every rename and its undo goes through Moved (Rename, its rollback, MoveBack), so the saved list stays right either way. The next update's Last used comes from the row.
  • Core/LauncherSettings.cs: Follow does the same for the remembered game files (a new build's Last used).
  • Core/GameFiles.cs: FoundGameFile.Follow, the same for the build's own pick.
  • App/ViewModels/BuildStepViewModel.cs: after the rename, job.Picked and the settings follow the folder, and the log says where the files are read from. After a failed build's put-back they follow it back, so Build again reads them from the old name.
  • App/ViewModels/HomeViewModel.cs: the home's one-time move of old-layout folders updates the remembered files too (LauncherService.FolderMoved).

make_game.py doesn't change. It already builds from a romfs inside its own output folder: link_or_copy hard-links each file onto itself, gets FileExistsError and skips it (checked on Windows, below). The exefs is copied into the work folder before .longshot_exefs is replaced. No new UI text, so no catalog changes.

How it was tested

Run by an AI agent (Claude Opus 5.5) working for me. Windows 11 Home 10.0.26200, .NET SDK 10.0.404, base 87b7072.

  1. Tests first. Commit 1 (ae3137b) adds only checks to tests/launcher_core/InstanceFolderChecks.cs: a go-back rename with two rows whose romfs and exefs are inside the renamed folder, plus one exefs elsewhere. Against main's code it fails at the new check: Game files a row was made from that were in the renamed folder follow it; files elsewhere stay as they were.

  2. The fix (commit 2, 58d920c) adds checks for LauncherSettings.Follow (changes once, then reports no change), FoundGameFile.Follow (the --romfs/--exefs it gives make_game.py) and InstanceFolders.Follow (a sibling with a shared name prefix, the folder itself, null). All instance-folder checks pass, including the files going back with MoveBack.

    On Windows the core run stops early on main, at unrelated checks: CRLF fixtures, then ShellLinkChecks on a Unicode scratch path. So I ran InstanceFolderChecks early (moved after ReleaseNotesChecks in a local, uncommitted edit, with a marker line) via python -I tests/test_launcher_core.py. CI runs the whole suite on Linux.

  3. dotnet build App builds with no warnings.

  4. Hard-linking a romfs file onto itself with Python on Windows raises FileExistsError and leaves the file as it was. That is the path make_game.py takes when the romfs is in its own output folder.

Not tested: a real update in the launcher (Nightly N to N+1 with the build's own romfs picked), on either OS. Needs: that run. abi's setup (Linux, /mnt/hp/Games/…) is the natural one.

🤖 Generated with Claude Code

**Type:** fix · **Risk:** low · **Tested on:** Windows 11 Home (26200), .NET SDK 10.0.404: the instance-folder core checks (fail on main, pass here), a build of the App project; no build run in the launcher · **Needs:** a player who updates with game files picked inside the build's own folder (the reporter is on Linux) ## TL;DR An update renames its build's folder to the new version's name when the build starts (`builds/nightly/nightly-483-…` to `nightly-486-…`). If the player picked game files inside that folder (its own `romfs` and `.longshot_exefs`, so they don't need the dump again), the launcher still gave `make_game.py` the old paths. Those were gone, so the build stopped straight away with a misleading message: > The romfs folder /mnt/hp/Games/Ocarina of Time/Longshot/nightly/nightly-483-7daafa7a/romfs does not hold the game's files (no Pack/ZsDic.pack.zs): choose the extracted RomFS. Now paths inside a renamed folder follow it to its new name. That covers the build's pick, the list's rows and the remembered *Last used* files. ## Why Reported by abi in Discord #support (2026-11-19, building Nightly 486 over 483): "I've just been pointing at the romfs and exefs from the previous nightly, but after some launcher updates (I think the nightly folder layout changes) it runs into this… think it may be renaming and conflicting with itself". Their workaround is to copy the files out of the folder first. The order of events at `87b7072`: 1. `SettingsStepViewModel.Start` remembers the picked romfs and exefs (inside `nightly-483-…`). `BuildStepViewModel.Run` then calls `RenameFolder` before anything else. 2. `InstanceFolders.Rename` moves the folder to `nightly-486-…`. Only the row's `Folder` follows (`BuildRegistry.Moved`). 3. `Run` builds the request from `job.Picked`, which still names `nightly-483-…/romfs`. `make_game.py`'s `check_romfs_folder` finds nothing there and fails. This started with the `builds/<track>/<version>` layout. Before it, an update built in a folder that kept its name, so the same pick worked. ## What changed - `Core/InstanceFolders.cs`: `Follow(path, from, to)`. A path inside `from`, or `from` itself, maps to the same place under `to`. Any other path is returned unchanged, including a sibling whose name starts the same (`nightly-483-x-other`). - `Core/BuildRegistry.cs`: `Moved` also moves every row's `Nup`, `Romfs` and `Exefs` that were inside the renamed folder. Every rename and its undo goes through `Moved` (`Rename`, its rollback, `MoveBack`), so the saved list stays right either way. The next update's *Last used* comes from the row. - `Core/LauncherSettings.cs`: `Follow` does the same for the remembered game files (a new build's *Last used*). - `Core/GameFiles.cs`: `FoundGameFile.Follow`, the same for the build's own pick. - `App/ViewModels/BuildStepViewModel.cs`: after the rename, `job.Picked` and the settings follow the folder, and the log says where the files are read from. After a failed build's put-back they follow it back, so **Build again** reads them from the old name. - `App/ViewModels/HomeViewModel.cs`: the home's one-time move of old-layout folders updates the remembered files too (`LauncherService.FolderMoved`). `make_game.py` doesn't change. It already builds from a romfs inside its own output folder: `link_or_copy` hard-links each file onto itself, gets `FileExistsError` and skips it (checked on Windows, below). The exefs is copied into the work folder before `.longshot_exefs` is replaced. No new UI text, so no catalog changes. ## How it was tested Run by an AI agent (Claude Opus 5.5) working for me. Windows 11 Home 10.0.26200, .NET SDK 10.0.404, base `87b7072`. 1. **Tests first.** Commit 1 (`ae3137b`) adds only checks to `tests/launcher_core/InstanceFolderChecks.cs`: a go-back rename with two rows whose romfs and exefs are inside the renamed folder, plus one exefs elsewhere. Against main's code it fails at the new check: `Game files a row was made from that were in the renamed folder follow it; files elsewhere stay as they were.` 2. **The fix** (commit 2, `58d920c`) adds checks for `LauncherSettings.Follow` (changes once, then reports no change), `FoundGameFile.Follow` (the `--romfs`/`--exefs` it gives `make_game.py`) and `InstanceFolders.Follow` (a sibling with a shared name prefix, the folder itself, null). All instance-folder checks pass, including the files going back with `MoveBack`. On Windows the core run stops early on main, at unrelated checks: CRLF fixtures, then `ShellLinkChecks` on a Unicode scratch path. So I ran `InstanceFolderChecks` early (moved after `ReleaseNotesChecks` in a local, uncommitted edit, with a marker line) via `python -I tests/test_launcher_core.py`. CI runs the whole suite on Linux. 3. `dotnet build App` builds with no warnings. 4. Hard-linking a romfs file onto itself with Python on Windows raises `FileExistsError` and leaves the file as it was. That is the path `make_game.py` takes when the romfs is in its own output folder. **Not tested:** a real update in the launcher (Nightly N to N+1 with the build's own romfs picked), on either OS. **Needs:** that run. abi's setup (Linux, `/mnt/hp/Games/…`) is the natural one. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
An update renames its instance's folder to the new version's name before make_game.py starts. A player who
picked that folder's own romfs and .longshot_exefs as the game files (so the dump is not needed again) had
the build and the list keep the old path, and make_game.py stopped with "does not hold the game's files".
Fails on main: the rows' romfs and exefs keep the folder's old name.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
fix(update): game files picked in the folder an update renames are read from its new name
All checks were successful
CI / Compile and test (pull_request) Has been skipped
CI / Conventional Commit title (pull_request) Successful in 3s
58d920c432
An update or a go-back renames its instance's folder (builds/nightly/nightly-483-... to nightly-486-...) when
the build starts. Game files picked inside that folder (its romfs and .longshot_exefs, used so the dump is not
needed again) were still passed to make_game.py by the old path, which was gone, so the build stopped at once:
"The romfs folder .../nightly-483-.../romfs does not hold the game's files (no Pack/ZsDic.pack.zs)".

InstanceFolders.Follow maps a path in a renamed folder to its new place. The build's pick, the list's rows
(BuildRegistry.Moved) and the remembered Last used files (LauncherSettings.Follow) follow every rename: an
update's, a go-back's, the home's move, and a failed build's put-back. make_game.py already builds from a
romfs inside its own output folder (it links each file onto itself and passes over it).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Member

Possibly related, for context:

  • issue #156 Can we not have to link rom to update — Related update workflow: reusing files already in the build folder
Possibly related, for context: - issue #156 Can we not have to link rom to update — Related update workflow: reusing files already in the build folder
HumanBean deleted branch fix/update-picked-folders-follow-rename 2026-11-19 16:07:04 +00:00
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!207
No description provided.