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:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user