diff --git a/SPTInstaller/Installer Tasks/PreChecks/EftInstalledPreCheck.cs b/SPTInstaller/Installer Tasks/PreChecks/EftInstalledPreCheck.cs new file mode 100644 index 0000000..f6926ed --- /dev/null +++ b/SPTInstaller/Installer Tasks/PreChecks/EftInstalledPreCheck.cs @@ -0,0 +1,24 @@ +using System.Threading.Tasks; +using SPTInstaller.Models; + +namespace SPTInstaller.Installer_Tasks.PreChecks; + +public class EftInstalledPreCheck : PreCheckBase +{ + private InternalData _internalData; + + public EftInstalledPreCheck(InternalData data) : base("EFT Installed", true) + { + _internalData = data; + } + + public override async Task CheckOperation() + { + if (_internalData.OriginalGamePath is null || !Directory.Exists(_internalData.OriginalGamePath) || !File.Exists(Path.Join(_internalData.OriginalGamePath, "Escapefromtarkov.exe"))) + { + return PreCheckResult.FromError("EFT installation could not be found", "Retry", RequestReevaluation); + } + + return PreCheckResult.FromSuccess("EFT install folder found"); + } +} \ No newline at end of file diff --git a/SPTInstaller/Installer Tasks/PreChecks/FreeSpacePreCheck.cs b/SPTInstaller/Installer Tasks/PreChecks/FreeSpacePreCheck.cs index cc2ddde..2e24368 100644 --- a/SPTInstaller/Installer Tasks/PreChecks/FreeSpacePreCheck.cs +++ b/SPTInstaller/Installer Tasks/PreChecks/FreeSpacePreCheck.cs @@ -33,7 +33,7 @@ public class FreeSpacePreCheck : PreCheckBase if (eftSourceDirSize == -1) { - return PreCheckResult.FromError("An error occurred while getting the EFT source directory size"); + return PreCheckResult.FromError("An error occurred while getting the EFT source directory size. This is most likely because EFT is not installed"); } var availableSize = DriveInfo.GetDrives() diff --git a/SPTInstaller/Program.cs b/SPTInstaller/Program.cs index 99c9c75..ca4306e 100644 --- a/SPTInstaller/Program.cs +++ b/SPTInstaller/Program.cs @@ -44,6 +44,7 @@ internal class Program ServiceHelper.Register(); #if !TEST + ServiceHelper.Register(); ServiceHelper.Register(); ServiceHelper.Register(); ServiceHelper.Register(); diff --git a/SPTInstaller/SPTInstaller.csproj b/SPTInstaller/SPTInstaller.csproj index 7dc3185..36567aa 100644 --- a/SPTInstaller/SPTInstaller.csproj +++ b/SPTInstaller/SPTInstaller.csproj @@ -10,8 +10,8 @@ icon.ico Assets\spt_installer.ico Debug;Release;TEST - 2.81 - 2.81 + 2.82 + 2.82 SPT diff --git a/SPTInstaller/ViewModels/InstallPathSelectionViewModel.cs b/SPTInstaller/ViewModels/InstallPathSelectionViewModel.cs index b2c9547..fcac7c7 100644 --- a/SPTInstaller/ViewModels/InstallPathSelectionViewModel.cs +++ b/SPTInstaller/ViewModels/InstallPathSelectionViewModel.cs @@ -69,7 +69,7 @@ public class InstallPathSelectionViewModel : ViewModelBase Title = "Select a folder to install SPT into" }); - SelectedPath = selections.First().Path.AbsolutePath.Replace("/", "\\"); + SelectedPath = selections.First().Path.LocalPath; } } diff --git a/SPTInstaller/ViewModels/InstallerUpdateViewModel.cs b/SPTInstaller/ViewModels/InstallerUpdateViewModel.cs index 24fd3ee..5bf8fb8 100644 --- a/SPTInstaller/ViewModels/InstallerUpdateViewModel.cs +++ b/SPTInstaller/ViewModels/InstallerUpdateViewModel.cs @@ -21,6 +21,7 @@ public class InstallerUpdateViewModel : ViewModelBase Task.Run(async () => { await UpdateInfo.CheckForUpdates(Assembly.GetExecutingAssembly().GetName().Version); + if (!UpdateInfo.UpdateAvailable) { NavigateTo(new InstallPathSelectionViewModel(HostScreen, _debugging)); diff --git a/SPTInstaller/Views/InstallerUpdateView.axaml b/SPTInstaller/Views/InstallerUpdateView.axaml index 13493bb..75cb8b7 100644 --- a/SPTInstaller/Views/InstallerUpdateView.axaml +++ b/SPTInstaller/Views/InstallerUpdateView.axaml @@ -13,6 +13,7 @@