fix(wizard): a build whose version folder is spelled verbatim is accepted #299
No reviewers
Labels
No labels
area/build
area/install
area/mods
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!299
Loading…
Reference in a new issue
No description provided.
Delete branch "enum/LongshotLauncher:fix/game-folder-check"
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?
On Windows, a build that succeeds is rejected with "The game folder is missing from this version." whenever the versions sit in a data folder apart from the launcher home. An installed launcher keeps its data in
%LOCALAPPDATA%\Longshot\data, apart from its home%LOCALAPPDATA%\LongshotLauncher, so every installed copy on Windows takes this path. Fixes MagicBeanDev/Longshot#2661.Cause
library::reservecanonicalizes the versions folder when it is not<home>\versions, so the version folder, and with it the builder's pathp.exe, are spelled verbatim:\\?\C:\....std::env::current_exe()givesC:\...; I checked this with a small program that starts itself by its\\?\path. The builder names its game folder from that path, so thedoneevent'sfolderisC:\...\builds\default.src/game/wizard.rs) comparedfolder.parent()with<version>\buildsasPaths.Prefix::VerbatimDiskandPrefix::Disknever compare equal, so the check failed although the folder was there, as the player found withTest-Path.What changes
built_in(folder, version). It compares the two as paths and, on Windows, also as folders on disk (both canonicalized), asVersion::owns_buildalready does. It still refuses a folder that isn't there and one outside the version'sbuilds.<version>\builds\<name>), not the builder's. Soversions::registerstores the same spelling as the version folder, the one the registry's lookups (new_build'sv.folder == folder,register'sexisting) compare with.mainfor this reason (Nonefor a plain game folder in a verbatim version folder), then the fix.Read first:
built_ininsrc/game/wizard.rs.Testing
Tested on Windows 11, RTX 4070, Rust 1.99.1 (msvc):
LONGSHOT_LAUNCHER_HOME) withdataFolderset to a folder outside it, the layout an installed launcher has, and the nightly-842-86b3b9e4 builder.main(d61d2e9f): the build finished, then "The build stopped. The game folder is missing from this version."builds\default\longshot.exewas there, 806,823,424 bytes, as in the report.folderis in the launcher's spelling (\\?\...\builds\default).game::wizard::windows_tests::a_game_folder_the_builder_names_plainly_is_in_a_verbatim_version_folder(Windows only, like the prefix): fails onmain, passes here.cargo test --locked: 123 passed, 10 failed.mainon this PC gives 122 passed and the same 10 failed. They are the Windows-only failures listed in #298 (that list also hasupdate::releases::release_py_fixture_verifies_exact_bytes_only, which passes here). CI runs Linux.cargo fmt --check,cargo clippy --locked --all-targets -- -D warnings: clean.LAUNCHER=$PWD python -I ../Tooling/tests/test_release.py: 46 tests OK.tests/test_launcher_core.pyruns the samecargo test, so it stops on those 10 on Windows.Still to test: None on Windows. Linux is unchanged: there the spellings are the same, and the extra comparison is Windows only.
Measurements
None needed. The change is one check that runs once at the end of a build: two
canonicalizecalls when the spellings differ, none otherwise. The game, the build's time and size, and the launcher's start are not touched.Risks
<tag>.instance-2; I saw this in the run above. Existing leftover handling covers the old folder; nothing new here.\\?\) changes how chosen folders are saved, notlibrary::reserveor this check.🤖 Generated with Claude Code
Tested in game: Windows 11, RTX 4070: a test launcher home with its data folder apart (an installed launcher's layout), nightly-842 builder. main's launcher: build finished, then 'The game folder is missing from this version.' This branch, same home: build finished, version installed, Play started the game.
Possibly related, for context:
Measurements section added: nothing to measure, one check at the end of a build.
WIP: fix(wizard): a build whose version folder is spelled verbatim is acceptedto fix(wizard): a build whose version folder is spelled verbatim is accepted