fix(update): game files picked in the folder an update renames are read from its new name #207
No reviewers
Labels
No labels
area/build
area/install
area/saves
area/tooling
area/ui
area/updates
ci: approved
good first issue
gpu/amd
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
platform/linux
platform/steam-deck
platform/windows
priority
critical
priority
high
priority
low
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/LongshotLauncher!207
Loading…
Reference in a new issue
No description provided.
Delete branch "madebyjordan/LongshotLauncher:fix/update-picked-folders-follow-rename"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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-…tonightly-486-…). If the player picked game files inside that folder (its ownromfsand.longshot_exefs, so they don't need the dump again), the launcher still gavemake_game.pythe old paths. Those were gone, so the build stopped straight away with a misleading message: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:SettingsStepViewModel.Startremembers the picked romfs and exefs (insidenightly-483-…).BuildStepViewModel.Runthen callsRenameFolderbefore anything else.InstanceFolders.Renamemoves the folder tonightly-486-…. Only the row'sFolderfollows (BuildRegistry.Moved).Runbuilds the request fromjob.Picked, which still namesnightly-483-…/romfs.make_game.py'scheck_romfs_folderfinds 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 insidefrom, orfromitself, maps to the same place underto. Any other path is returned unchanged, including a sibling whose name starts the same (nightly-483-x-other).Core/BuildRegistry.cs:Movedalso moves every row'sNup,RomfsandExefsthat were inside the renamed folder. Every rename and its undo goes throughMoved(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:Followdoes 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.Pickedand 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.pydoesn't change. It already builds from a romfs inside its own output folder:link_or_copyhard-links each file onto itself, getsFileExistsErrorand skips it (checked on Windows, below). The exefs is copied into the work folder before.longshot_exefsis 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.Tests first. Commit 1 (
ae3137b) adds only checks totests/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.The fix (commit 2,
58d920c) adds checks forLauncherSettings.Follow(changes once, then reports no change),FoundGameFile.Follow(the--romfs/--exefsit givesmake_game.py) andInstanceFolders.Follow(a sibling with a shared name prefix, the folder itself, null). All instance-folder checks pass, including the files going back withMoveBack.On Windows the core run stops early on main, at unrelated checks: CRLF fixtures, then
ShellLinkCheckson a Unicode scratch path. So I ranInstanceFolderChecksearly (moved afterReleaseNotesChecksin a local, uncommitted edit, with a marker line) viapython -I tests/test_launcher_core.py. CI runs the whole suite on Linux.dotnet build Appbuilds with no warnings.Hard-linking a romfs file onto itself with Python on Windows raises
FileExistsErrorand leaves the file as it was. That is the pathmake_game.pytakes 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
Possibly related, for context: