Fix forever installing (#3135)

* Rough draft for fix for Mojang servers being down causing infinite installation

* Add "pack installed" install step

* Allow repairing an instance from Library to recover pack contents

* Allow repair from instance page

* Deduplicate repair code

* Fix lint

* Fix lint (for real this time)

---------

Co-authored-by: Jai Agrawal <18202329+Geometrically@users.noreply.github.com>
This commit is contained in:
Josiah Glosson
2025-01-11 17:27:47 -06:00
committed by GitHub
parent abd679d716
commit 227386bb0d
14 changed files with 170 additions and 74 deletions

View File

@@ -7,11 +7,7 @@ use crate::state::{
Credentials, JavaVersion, ProcessMetadata, ProfileInstallStage,
};
use crate::util::io;
use crate::{
process,
state::{self as st},
State,
};
use crate::{process, state as st, State};
use chrono::Utc;
use daedalus as d;
use daedalus::minecraft::{RuleAction, VersionInfo};
@@ -199,7 +195,7 @@ pub async fn install_minecraft(
.await?;
crate::api::profile::edit(&profile.path, |prof| {
prof.install_stage = ProfileInstallStage::Installing;
prof.install_stage = ProfileInstallStage::MinecraftInstalling;
async { Ok(()) }
})
@@ -431,7 +427,7 @@ pub async fn launch_minecraft(
profile: &Profile,
) -> crate::Result<ProcessMetadata> {
if profile.install_stage == ProfileInstallStage::PackInstalling
|| profile.install_stage == ProfileInstallStage::Installing
|| profile.install_stage == ProfileInstallStage::MinecraftInstalling
{
return Err(crate::ErrorKind::LauncherError(
"Profile is still installing".to_string(),