launcher: reach Prism's and MultiMC's shared libraries from an instance folder (#693)

A Prism or MultiMC instance keeps no jar of its own: the client sits in the
launcher root's shared libraries, two or three folders above `instances/`,
and the game is downloaded only once the instance is launched. Choosing
`%APPDATA%\PrismLauncher\instances` (or an instance's `minecraft`/`.minecraft`
folder) as the Minecraft folder failed Prepare when the jar was not there yet,
and the error only listed every launcher without saying what to do.

resolve now also looks in the launcher root above an `instances` folder, so a
folder deeper than the four walked above the chosen one still finds the
libraries. When nothing is found and the chosen folder is inside a launcher
Horizon knows, the error names it and says to launch the instance once so it
downloads the game.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rdbtCVS
2026-10-17 17:57:26 +01:00
parent 39ddc8db3d
commit 4b7812296e
3 changed files with 132 additions and 17 deletions
+1 -1
View File
@@ -792,7 +792,7 @@ pub fn preparer(
match sources::resolve(minecraft, &pins, &known, &linked, &fetch, log)? {
sources::Resolved::Folder(dir) => dir,
sources::Resolved::NotFound(checked) => {
let not_found = sources::not_found(&version, &checked);
let not_found = sources::not_found(&version, &checked, minecraft);
download_for_owner(&pins, &own, &fetch, log).map_err(|e| not_found + &e)?;
own
}