Merge pull request 'fix/uri-path' (#95) from waffle.lord/Installer:fix/uri-path into master

Reviewed-on: SPT/Installer#95
This commit is contained in:
IsWaffle 2024-06-30 16:39:39 +00:00
commit f7fbdee568
7 changed files with 31 additions and 4 deletions

View File

@ -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<PreCheckResult> 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");
}
}

View File

@ -33,7 +33,7 @@ public class FreeSpacePreCheck : PreCheckBase
if (eftSourceDirSize == -1) 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() var availableSize = DriveInfo.GetDrives()

View File

@ -44,6 +44,7 @@ internal class Program
ServiceHelper.Register<InternalData>(); ServiceHelper.Register<InternalData>();
#if !TEST #if !TEST
ServiceHelper.Register<PreCheckBase, EftInstalledPreCheck>();
ServiceHelper.Register<PreCheckBase, NetFramework472PreCheck>(); ServiceHelper.Register<PreCheckBase, NetFramework472PreCheck>();
ServiceHelper.Register<PreCheckBase, Net8PreCheck>(); ServiceHelper.Register<PreCheckBase, Net8PreCheck>();
ServiceHelper.Register<PreCheckBase, FreeSpacePreCheck>(); ServiceHelper.Register<PreCheckBase, FreeSpacePreCheck>();

View File

@ -10,8 +10,8 @@
<PackageIcon>icon.ico</PackageIcon> <PackageIcon>icon.ico</PackageIcon>
<ApplicationIcon>Assets\spt_installer.ico</ApplicationIcon> <ApplicationIcon>Assets\spt_installer.ico</ApplicationIcon>
<Configurations>Debug;Release;TEST</Configurations> <Configurations>Debug;Release;TEST</Configurations>
<AssemblyVersion>2.81</AssemblyVersion> <AssemblyVersion>2.82</AssemblyVersion>
<FileVersion>2.81</FileVersion> <FileVersion>2.82</FileVersion>
<Company>SPT</Company> <Company>SPT</Company>
</PropertyGroup> </PropertyGroup>

View File

@ -69,7 +69,7 @@ public class InstallPathSelectionViewModel : ViewModelBase
Title = "Select a folder to install SPT into" Title = "Select a folder to install SPT into"
}); });
SelectedPath = selections.First().Path.AbsolutePath.Replace("/", "\\"); SelectedPath = selections.First().Path.LocalPath;
} }
} }

View File

@ -21,6 +21,7 @@ public class InstallerUpdateViewModel : ViewModelBase
Task.Run(async () => Task.Run(async () =>
{ {
await UpdateInfo.CheckForUpdates(Assembly.GetExecutingAssembly().GetName().Version); await UpdateInfo.CheckForUpdates(Assembly.GetExecutingAssembly().GetName().Version);
if (!UpdateInfo.UpdateAvailable) if (!UpdateInfo.UpdateAvailable)
{ {
NavigateTo(new InstallPathSelectionViewModel(HostScreen, _debugging)); NavigateTo(new InstallPathSelectionViewModel(HostScreen, _debugging));

View File

@ -13,6 +13,7 @@
<ScrollViewer MaxHeight="250" Background="#323232"> <ScrollViewer MaxHeight="250" Background="#323232">
<TextBlock Text="{Binding UpdateInfo.ChangeLog}" <TextBlock Text="{Binding UpdateInfo.ChangeLog}"
TextWrapping="Wrap" MinHeight="100" TextWrapping="Wrap" MinHeight="100"
Margin="10"
/> />
</ScrollViewer> </ScrollViewer>
</StackPanel> </StackPanel>