Added umu download and repair for missing components on install, update and manual repair.
This commit is contained in:
@@ -11,7 +11,9 @@ import shutil
|
||||
from typing import Mapping
|
||||
|
||||
from .launcher import find_wine_tools
|
||||
from .paths import AppPaths
|
||||
from .runtime import find_steam_proton7
|
||||
from .umu import managed_umu_ready
|
||||
|
||||
|
||||
ARCH_FAMILY_DISTRIBUTIONS = frozenset(
|
||||
@@ -48,6 +50,7 @@ def inspect_host(environment: Mapping[str, str] | None = None) -> DoctorReport:
|
||||
distribution = os_release.get("ID", "unknown")
|
||||
version = os_release.get("VERSION_ID", "unknown")
|
||||
wine_tools = find_wine_tools()
|
||||
umu_path = _umu_path(env)
|
||||
tools = [
|
||||
ToolStatus(
|
||||
"python3",
|
||||
@@ -93,9 +96,9 @@ def inspect_host(environment: Mapping[str, str] | None = None) -> DoctorReport:
|
||||
),
|
||||
ToolStatus(
|
||||
"umu-run",
|
||||
shutil.which("umu-run"),
|
||||
umu_path,
|
||||
distribution in ARCH_FAMILY_DISTRIBUTIONS,
|
||||
"current portable Proton runtime; automatic on Arch-family hosts",
|
||||
"Steam Runtime container; managed automatically when needed",
|
||||
),
|
||||
ToolStatus(
|
||||
"vulkaninfo",
|
||||
@@ -110,14 +113,15 @@ def inspect_host(environment: Mapping[str, str] | None = None) -> DoctorReport:
|
||||
warnings.append("PristonTale EU requires an x86-64 host with 32-bit Vulkan support.")
|
||||
if not env.get("WAYLAND_DISPLAY") and not env.get("DISPLAY"):
|
||||
warnings.append("No graphical X11 or Wayland session is visible.")
|
||||
if shutil.which("umu-run") is None and not _has_steam_proton7(env):
|
||||
if umu_path is None and not _has_steam_proton7(env):
|
||||
warnings.append(
|
||||
"No game runtime was found: install umu-launcher or Steam Proton 7.0."
|
||||
"No local game runtime is installed yet; run runtime-bootstrap to fetch the "
|
||||
"pinned official UMU helper. Startup and Play also retry automatically."
|
||||
)
|
||||
warnings.extend(_arch_runtime_warnings(distribution, platform.machine()))
|
||||
required_ok = all(item.path is not None for item in tools if item.required)
|
||||
return DoctorReport(
|
||||
ok=required_ok and not any("No game runtime" in warning for warning in warnings),
|
||||
ok=required_ok,
|
||||
distribution=distribution,
|
||||
version=version,
|
||||
architecture=platform.machine(),
|
||||
@@ -180,6 +184,19 @@ def _has_steam_proton7(environment: Mapping[str, str]) -> bool:
|
||||
return find_steam_proton7(environment) is not None
|
||||
|
||||
|
||||
def _umu_path(environment: Mapping[str, str]) -> str | None:
|
||||
system = shutil.which("umu-run", path=environment.get("PATH"))
|
||||
if system:
|
||||
return system
|
||||
try:
|
||||
paths = AppPaths.from_environment(environment)
|
||||
except RuntimeError:
|
||||
return None
|
||||
if managed_umu_ready(paths.managed_umu_executable):
|
||||
return str(paths.managed_umu_executable.resolve())
|
||||
return None
|
||||
|
||||
|
||||
def _platform_optional_tools(distribution: str, *, architecture: str) -> list[ToolStatus]:
|
||||
if architecture.casefold() not in {"x86_64", "amd64"}:
|
||||
return []
|
||||
|
||||
Reference in New Issue
Block a user