Let the simulator be picked from outside the installation

A build tree kept beside the data can be chosen in the settings, and when no
simulator is found the starter asks for one instead of calling the
installation broken. The simulator now runs in the installation, not in the
folder of its binary, and a binary for the other system is no longer refused.
This commit is contained in:
maj00r
2026-10-04 13:27:28 +02:00
parent 2b3c46938c
commit 3083523ceb
17 changed files with 320 additions and 49 deletions

View File

@@ -53,13 +53,11 @@ public static class Diagnostics
Dispatcher.UIThread.Post(() => _ = ReportAsync(message, title));
}
public static List<string> CheckInstallation() =>
new InstallationCheck(
AppServices.Current.Paths,
AppServices.Current.Files,
AppServices.Current.Localization,
AppServices.Current.Physics,
AppServices.Current.Library,
AppServices.Current.SettingsStore)
.Run();
public static InstallationCheck InstallationCheck() =>
new(AppServices.Current.Paths,
AppServices.Current.Files,
AppServices.Current.Localization,
AppServices.Current.Physics,
AppServices.Current.Library,
AppServices.Current.SettingsStore);
}

View File

@@ -49,10 +49,17 @@ public sealed class InstallationCheck
if (_physics.IndexedCount == 0)
faults.Add(_strings["FaultNoPhysics"]);
_settings.ResolveExecutable(out var problem);
if (problem == ExeProblem.NotFound)
faults.Add(_strings["FaultNoExe"]);
return faults;
}
/// <summary>
/// Kept out of <see cref="Run"/>: a simulator missing from the installation does
/// not make it a broken one - it may be a build kept elsewhere, or a Windows
/// build for Wine, waiting to be picked.
/// </summary>
public bool ExecutableMissing()
{
_settings.ResolveExecutable(out var problem);
return problem == ExeProblem.NotFound;
}
}