feat(home): move a built version to another folder, with a progress page like a build's #261

Open
Mone wants to merge 1 commit from Mone/LongshotLauncher:feat/move-built-game into main
First-time contributor

A version's game folder could only stay where it was built: moving it by hand (another drive with room, say) left the launcher pointing at the old path. This adds Move… to a version's row, so the folder can go anywhere and stay listed and playable.

What changed

  • Move… on a built version's row: pick a folder, the game folder goes into it under its own name.
    • Same drive: one rename.
    • Another drive: copied into a staging folder beside the destination (.longshot-moving-…), links recreated rather than followed (links inside the folder are rebased), the builds list saved, and only then the old folder removed. A failure before the list is saved removes the staging folder and leaves everything as it was; a failure to save the list puts the folder back.
    • Free space is checked before a copy starts: the folder's bytes and 1% (at least 32 MB).
    • Refused while Longshot runs, for a folder that is a link, holds the launcher's data or the shared saves, or for a destination inside a build's folder.
  • The progress page is a build's step 3: heading and percentage, time left while files are copied, the bar, and the four stages (prepare the destination, move the game files, update the launcher's paths, remove the old folder) with their details and times. The destination's path shows on the first row, trimmed from its start so the folder's name stays.
  • Cancel while the destination is prepared or files are copied: the copy so far is deleted; the source and the builds list are untouched. After the copy has taken the destination's name there is nothing left to stop, and Cancel turns off.
  • While a move runs, the rest of the home (play, delete, builds, launcher update, the title bar's tabs) waits, and closing the window is refused with a toast.
  • Texts in every catalog (Core/Lang).

Core: Core/BuildRelocation.cs; app: MoveBuildProgressViewModel/MoveBuildProgressView, HomeViewModel.MoveBuildAsync.

Testing

Tested

  • dotnet build LongshotLauncher.slnx -c Release: 0 warnings, 0 errors.
  • tests/launcher_core/BuildRelocationChecks.cs (new, in the core suite): same-drive rename; cross-drive copy with the builds list and the remembered game-file paths following the build; the list after reloading it; a running game, an occupied destination and too little space refused with nothing changed; progress reports in order, ending at the total; Cancel during the copy keeps the source and the list and leaves no destination or staging folder.
  • The app tests (tests/launcher_app) pass.
  • On a real 31.2 GB build (Windows 11, NVMe C: to HDD E:): the progress page as in the screenshot below, then Cancel after ~1 GB: back on the home, the source still holds all 186,679 files (33,532,489,329 bytes), builds.json byte for byte as before, nothing left on E:. Earlier, the same build was moved across drives to C: in full with this branch's first version of the page: the home lists it in its new folder.

Still to test

  • A same-drive move (a rename) in the app, and playing a moved build from its new folder.
  • Linux and the Steam Deck (the copy keeps Unix modes and rebases relative links; not run there).
  • On this Windows PC the core suite stops at SavesChecks ("A link whose shared save folder is gone…") and scripts/translations.py reports catalog texts left over: both on main as it is too (checked on a clean checkout of 6887d57), not from this change.

Screenshots follow in a comment.

A version's game folder could only stay where it was built: moving it by hand (another drive with room, say) left the launcher pointing at the old path. This adds **Move…** to a version's row, so the folder can go anywhere and stay listed and playable. ## What changed - **Move…** on a built version's row: pick a folder, the game folder goes into it under its own name. - Same drive: one rename. - Another drive: copied into a staging folder beside the destination (`.longshot-moving-…`), links recreated rather than followed (links inside the folder are rebased), the builds list saved, and only then the old folder removed. A failure before the list is saved removes the staging folder and leaves everything as it was; a failure to save the list puts the folder back. - Free space is checked before a copy starts: the folder's bytes and 1% (at least 32 MB). - Refused while Longshot runs, for a folder that is a link, holds the launcher's data or the shared saves, or for a destination inside a build's folder. - **The progress page is a build's step 3**: heading and percentage, time left while files are copied, the bar, and the four stages (prepare the destination, move the game files, update the launcher's paths, remove the old folder) with their details and times. The destination's path shows on the first row, trimmed from its start so the folder's name stays. - **Cancel** while the destination is prepared or files are copied: the copy so far is deleted; the source and the builds list are untouched. After the copy has taken the destination's name there is nothing left to stop, and Cancel turns off. - While a move runs, the rest of the home (play, delete, builds, launcher update, the title bar's tabs) waits, and closing the window is refused with a toast. - Texts in every catalog (`Core/Lang`). Core: `Core/BuildRelocation.cs`; app: `MoveBuildProgressViewModel`/`MoveBuildProgressView`, `HomeViewModel.MoveBuildAsync`. ## Testing **Tested** - `dotnet build LongshotLauncher.slnx -c Release`: 0 warnings, 0 errors. - `tests/launcher_core/BuildRelocationChecks.cs` (new, in the core suite): same-drive rename; cross-drive copy with the builds list and the remembered game-file paths following the build; the list after reloading it; a running game, an occupied destination and too little space refused with nothing changed; progress reports in order, ending at the total; **Cancel during the copy** keeps the source and the list and leaves no destination or staging folder. - The app tests (`tests/launcher_app`) pass. - On a real 31.2 GB build (Windows 11, NVMe C: to HDD E:): the progress page as in the screenshot below, then **Cancel** after ~1 GB: back on the home, the source still holds all 186,679 files (33,532,489,329 bytes), `builds.json` byte for byte as before, nothing left on E:. Earlier, the same build was moved across drives to C: in full with this branch's first version of the page: the home lists it in its new folder. **Still to test** - A same-drive move (a rename) in the app, and playing a moved build from its new folder. - Linux and the Steam Deck (the copy keeps Unix modes and rebases relative links; not run there). - On this Windows PC the core suite stops at `SavesChecks` ("A link whose shared save folder is gone…") and `scripts/translations.py` reports catalog texts left over: both on `main` as it is too (checked on a clean checkout of 6887d57), not from this change. Screenshots follow in a comment.
feat(home): move a built version to another folder, with a progress page like a build's
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Compile and test (pull_request) Blocked by required conditions
7d40f795a9
A version's row has Move...: pick a folder and the game folder goes there, still listed and still playing. On the same
drive it is renamed; across drives it is copied to a staging folder, the builds list saved, and only then is the old
folder removed. Free space is checked first (the folder's bytes and 1%), and Cancel stops a copy before it takes the
destination's name, leaving the source and the list as they were.

The page is the build's step 3: the heading, the percentage and the time left, the bar, and the stages with their
details and times (prepare, move the files, update the launcher's paths, remove the old folder).

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

Possibly related, for context:

  • PR #248 WIP: fix(update): an update built from its own folder's game files reads them after the folder is renamed — Open PR touches build-folder path updates; review for overlapping registry/path changes.
  • issue #240 Launcher: Update fails after renaming .longshot_exefs and build folder — Open report of stale paths after a build folder is renamed.
  • PR #207 fix(update): game files picked in the folder an update renames are read from its new name — Merged predecessor updates remembered game-file paths when a folder moves.
Possibly related, for context: - PR #248 WIP: fix(update): an update built from its own folder's game files reads them after the folder is renamed — Open PR touches build-folder path updates; review for overlapping registry/path changes. - issue #240 Launcher: Update fails after renaming .longshot_exefs and build folder — Open report of stale paths after a build folder is renamed. - PR #207 fix(update): game files picked in the folder an update renames are read from its new name — Merged predecessor updates remembered game-file paths when a folder moves.
Author
First-time contributor

Screenshots (Windows 11, launcher in Italian; taken on a local build with #262 and #263 in it too, so the row also shows the gear). The destination's path is blanked out.

The move's page, ~1 GB into a cross-drive copy of a 31.2 GB version, before Cancel:

Move progress

The row with Move…:

Home row

Screenshots (Windows 11, launcher in Italian; taken on a local build with #262 and #263 in it too, so the row also shows the gear). The destination's path is blanked out. The move's page, ~1 GB into a cross-drive copy of a 31.2 GB version, before Cancel: ![Move progress](https://git.magicbean.dev/attachments/f4c5f19b-2f97-42cc-965e-8ec9de3ecde0) The row with Move…: ![Home row](https://git.magicbean.dev/attachments/4abfacc3-691b-4a9f-be34-72f657349266)
Some checks are pending
CI / Conventional Commit title (pull_request) Blocked by required conditions
CI / Compile and test (pull_request) Blocked by required conditions
This pull request doesn't have enough approvals yet. 0 of 1 approvals granted.
Some workflows are waiting to be reviewed.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u 'feat/move-built-game:Mone-feat/move-built-game'
git switch 'Mone-feat/move-built-game'
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!261
No description provided.