mirror of
https://github.com/MaSzyna-EU07/StarterNG.git
synced 2026-11-19 06:55:59 +01:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user