fix(launcher): refresh local installations and keep upgrades connected #321
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!321
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/LongshotLauncher:fix/installation-library"
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?
A playable build could disappear from Versions when its directory was renamed or its registry entry was retired. Upgrading could also leave a large obsolete build and a stale Steam shortcut, while opening a folder could block the launcher until the file manager returned.
Verification
A Linux window test displayed all three playable fixture copies, including one with a renamed directory. Clicking the original game, Longshot data, and cache paths produced three file-manager calls with the expected directories. Resetting the fixture cache displayed the compact “Folder updated.” notice. Screenshots below use synthetic data.
Regression tests cover preservation of an extra file during cleanup, a rename within the library, a move out of it, and the original Steam shortcut targeting the same executable path after its contents change. Steam shortcut behavior was tested using a local shortcuts.vdf fixture. Windows desktop interaction and launching a retail game through the Steam client remain unverified.
The native window picked up a fourth fixture installation added on disk. After clicking Open folder, the Saves page opened while the simulated file manager was still running. Locked Clippy, formatting, launcher core and shared release checks passed.
Review follow-up: an upgrade or rebuild of a discovered, unowned copy now stops before download and offers Add version for a separate managed copy. Local build mods carry forward, and cache cleanup preserves unrecognized files. The broader handling of modified build outputs at their original paths belongs to the separate layout change.
Versions and Settings on Linux, using a synthetic library.
Possibly related, for context:
Each new installation now gets a permanent 16-character hexadecimal folder name. An upgrade replaces the build in that folder and Steam targets its executable directly. The regression fixtures cover two copies, rollback, retired build cleanup, and an unchanged Steam shortcut.
@review
Recommendation: Request changes. Steam shortcuts now bypass launcher preparation and trust checks, and upgrades fail for discovered copies that the launcher does not own. Upgrades also move existing build-local files away from their expected paths.
The change discovers and refreshes local installations, stages upgrades, cleans retired outputs, and makes paths clickable. Stable executable paths are useful, but the new Steam and upgrade paths introduce player-facing regressions.
Blocking (3): must change before merging.
src/game/steam/library.rs:513: The direct Steam target bypasses the launcher's game preparation and mod trust checks. (more on the line) Do: Keep Steam launching through the launcher, or provide an equivalent stable entry point that performs the same trust checks and launch preparation before starting the builder.src/game/wizard.rs:627: Discovered installations can be selected for upgrade, but replacement requires launcher ownership that discovery explicitly does not grant. (more on the line) Do: Handle unowned discovered copies explicitly before starting the build, with a safe upgrade path or a clear choice to install a separate managed copy.src/game/wizard.rs:656: Replacing the entire builds directory removes additional and modified files from the active installation's paths. (more on the line) Do: Carry non-generated and modified files into their corresponding active build paths, resolving collisions safely, instead of moving them away with the retired outputs.Should fix (1): not blocking, but worth doing before merging.
src/live.rs:170: A live rename reconnects the registry but does not reconnect existing Steam shortcuts. (more on the line) Do: Retarget affected shortcuts after a successful live reconnection, with the same ownership and ambiguity checks used at startup.Testing before merging (1) (runs on the systems it can change; it doesn't hold the recommendation)
src/game/steam/library.rs:513: The changed launch path needs a real Steam client check on supported platforms. (more on the line) Do: Exercise an install, upgrade and Steam launch with a retail game on Windows and Linux, including a selected profile and enabled mods.@fixcan do L1, L2, L3 and L4.Checks: Still running:
CI / Rust formatting, lint and tests (pull_request),CI / Release packages and stable upgrades (pull_request).More: does it help, other systems, switches, what was read
Does it help: Unproven overall. The description reports a Linux window test with three fixture copies and a fourth added on disk, plus a Steam VDF fixture; it says Windows desktop interaction and a retail game launch through Steam were not verified.
Other systems: Steam launches bypass launcher-provided environment, mod trust, sharing, cache and upscaler preparation on both operating systems. Upgrade replacement affects build-local files and discovered copies. Windows file operations and real Steam launches remain unverified.
Switches: No switches added, changed or removed.
Reviewed:
ff26d1f6deagainstdf3d1dc174: Read AGENTS.md, CONTRIBUTING.md, docs/pull-requests.md, the commit messages, the diff, and the principal changed Rust paths and their callers. Skimmed the Slint changes and reported fixture runs; did not read every changed code file in full. No review checklist or pull request template was found.; nothing run (a code review).Checked and fine:
Testing: No commands that build, run tests, or execute project code were run. The reported locked checks passed locally; both Forgejo CI checks are still running.
Overlaps and merge order: Not checked; the network is closed.
Automated code review by BeanBot (gpt-6.1-terra), asked for by HumanBean. Nothing was run; a maintainer decides.
@ -432,0 +510,4 @@profile: &Path,home: &Path,) -> Result<()> {let exe = argument(target_builder)?;L1 (blocking): The direct Steam target bypasses the launcher's game preparation and mod trust checks.
When: Starting a migrated shortcut invokes the builder directly with only the profile argument. It never enters versions::play or start_for, so newly added mod permissions are not reviewed and launcher settings such as the profile's HOS_MODS path, configured cache, gamescope and upscalers are not applied.
Do: Keep Steam launching through the launcher, or provide an equivalent stable entry point that performs the same trust checks and launch preparation before starting the builder.
L5 (should fix): The changed launch path needs a real Steam client check on supported platforms.
When: The VDF fixture verifies the stored target and arguments, but the description says a retail game has not been launched through Steam and Windows desktop interaction remains unverified.
Do: Exercise an install, upgrade and Steam launch with a retail game on Windows and Linux, including a selected profile and enabled mods.
@ -607,0 +624,4 @@register: impl FnOnce() -> Result<()>,) -> Result<()> {use std::fs;ensure!(L2 (blocking): Discovered installations can be selected for upgrade, but replacement requires launcher ownership that discovery explicitly does not grant.
When: A playable copy in a custom library has no ownership record. It appears in Versions and the update wizard builds a replacement, but replace_instance rejects the old folder after the build has completed.
Do: Handle unowned discovered copies explicitly before starting the build, with a safe upgrade path or a clear choice to install a separate managed copy.
@ -607,0 +653,4 @@for entry in fs::read_dir(active)? {let entry = entry?;let name = entry.file_name();if name != ".longshot-launcher-owner"L3 (blocking): Replacing the entire builds directory removes additional and modified files from the active installation's paths.
When: A player has a local mods or cache directory under builds/default. Upgrade moves it into the retired staging directory; cleanup then moves residuals to a randomly named preserved-files directory, leaving the upgraded game without those files at their original paths.
Do: Carry non-generated and modified files into their corresponding active build paths, resolving collisions safely, instead of moving them away with the retired outputs.
@ -0,0 +167,4 @@let _ = crate::preferences::refresh(&ui, &root);}}if (previous.versions != now.versions || people_changed)L4 (should fix): A live rename reconnects the registry but does not reconnect existing Steam shortcuts.
When: While the launcher is open, a player renames an owned installation in the library. The watcher updates its registry row, but shortcut migration only runs during binding, so the Steam shortcut keeps pointing at the missing old path until the launcher is restarted.
Do: Retarget affected shortcuts after a successful live reconnection, with the same ownership and ambiguity checks used at startup.
Upgrades now carry settings and local reports into the matching build and remove obsolete cache. The regression fixture includes language, custom options, a pending report, an empty log directory and a stale prompt cache. It verifies that upgrading these creates no preserved-files directory and that a failed registration restores the original settings.
Pushed
26994f0017. L2 and L4 now have regression fixtures for unowned-copy handling before a build starts and direct shortcut repair after a live rename. L3 now carries build-local mods and protects unknown cache files. Generic collision handling for locally modified build outputs remains for the separate layout change. For L1, the Steam target remains the instance builder as requested. At nightly 857 its play command prepares the profile, checks for a stale build and starts the game. The shortcut now passes the configured cache, per-instance upscalers and --no-self-update. The separate launcher approval dialog and environment setup do not run on a direct builder launch. The fixture verifies the direct target, arguments, preserved app ID and profile isolation. L5 retail Steam launches with mods on Linux and Windows remain unverified. Local formatting, locked Clippy, 186 launcher tests, shared release checks and the desktop build passed.