WIP: fix(update): an update stays in its build's folder, and a new build's is named after its channel #57
No reviewers
Labels
No labels
area/build
area/install
area/saves
area/ui
area/updates
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
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/LongshotLauncher!57
Loading…
Reference in a new issue
No description provided.
Delete branch "Victor/LongshotLauncher:fix/update-keeps-folder"
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?
Every update of a build made a new game folder named after the new version (
Games\Longshot\nightly-77-9f64464b), so the game's path changed at each update. A GPU driver's settings for the program stopped applying (MagicBeanDev/Longshot#224: NVIDIA Smooth Motion had to be set again after every update), the settings, mods and shader caches stayed behind in the old folder, and the old folder, a whole copy of the game, stayed on the disk with no row in the list to delete it from.Why
BuildJobgave an update<builds>/<new version>; only a rebuild used its build's folder.BuildRegistry.Replacethen moved the row to the new folder, and the README's design decisions said of the old one: "The old folder stays on the disk; nothing deletes it yet."mainis an update, so it happened several times a week.longshot_options.ini,longshot_env.txtandmods. That is true of an update in the same folder, not of one built in a new folder..nupthe folder was unpacked from, and it copies the new files in as<name>.newand swaps them only once all are complete, so a build that stops leaves the old game playable (nx2/make_game.py, read from its source, not run here).What changed
Core/BuildRegistry.csFolderOf: an update or a rebuild is built in its build's own folder; a new build goes inNewFolder.NewFolder: the channel's folder in the builds folder, past the folders other builds have and past anything on the disk that is not a game folder. A game folder no build lists is built in again, as one the player picks already was.PickedFolder: the rule for a folder the player picks in step 2 (a folder that holds other things gets the build's own folder in it), moved here fromSettingsStepViewModelso the tests reach it.Replace: when the folder stays, a row named after its version takes the new version's name.Core/LauncherSettings.cs:FolderFornames a new build's folder after its channel (nightly,rc,stable, thennightly (2)), not its version.App/ViewModels/WizardViewModel.cs:BuildJobtakes its folder fromFolderOf.App/ViewModels/SettingsStepViewModel.cs:ChangeInstallAsyncusesPickedFolder.Startdoes not start a build into a folder that has a game while Longshot runs ("Save and close Longshot first: this replaces the game in its folder."), as Delete already refuses: on Windows make_game.py would build for minutes and stop at its last step, the swap.App/Views/SettingsView.axaml: the hint under Where builds go.Core/Lang/*.json: the 12 full catalogs have the new hint in place of the old one, and the new toast.README.md: the design decision is now "An update stays in its build's folder", with a new one for the folder's name; Planned next says<channel>where it said<version>.tests/launcher_core/ScreenChecks.cs:UpdateFolderChecks(new) and theFolderForcheck.Builds made before this keep the folder they have, named after a version: their next update stays in it. Nothing is renamed or deleted.
For you to decide
FolderFor. A build whose channel the player changes later keeps its folder's name.~/Games/Longshot/versions/<version>. A folder per version would bring back the path change at every update.LauncherService.GatherSavesalready finds the game folders in the builds folder that no build lists, andBuildRegistry.DeleteFolderhas the checks.Disk.BuildBytes) for an update in its folder, which needs less. Not changed: I have no measurement.--update(BuildSource.Update) builds from the files the folder keeps.Testing
Linux (Arch), .NET SDK 10.0.100, this branch @
6e56794on main @01f2797.python3 -I tests/test_launcher_core.py --strict --longshot <Longshot @ 514591a3>: 970 checks passed (main @01f2797: 956).FolderOfgiving an update a new folder again, the run stops at "An update or a rebuild is built in its build's own folder, wherever new builds go."python3 -I scripts/translations.py: 522 texts, 15 catalogs, all complete.python3 -I tests/test_release.py: 28 tests, OK.dotnet build LongshotLauncher.slnx: 0 warnings, 0 errors.Not tested: the launcher's window was not run, and no real build was updated: there is no game dump on this PC. Nothing was run on Windows, and the NVIDIA settings themselves were not checked. No screenshot of the Settings hint.
How to test
Wanted on Windows with an NVIDIA card; on Linux the same steps without the driver's part. WIP until someone has. You need a build on the nightly channel with an update waiting (any nightly but the newest). It is your real build that gets updated.
In the NVIDIA app, add the build's
bin\longshot.exeand change one setting for it (Smooth Motion, say).In the game, change a row in the Insert menu, and put a mod in the game folder's
mods. Leave the game running, and close the launcher.Run this PR's launcher (it needs the .NET 10 SDK). It uses the installed launcher's data, so your builds are listed:
Press Update on the build. At step 2, Game folder should be the folder the build already has. With the game still running, Update to … should say "Save and close Longshot first" and start nothing. Close the game, press it again and let the build finish.
Check, and say in a comment here what you saw, with your Windows version, GPU and driver:
Optional, a whole build: build another channel's version (stable, say) from the channel picker. Its folder should be named after the channel (
stable).Issue: MagicBeanDev/Longshot#224
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.