diff --git a/.idea/.idea.SPTInstaller/.idea/.gitignore b/.idea/.idea.SPTInstaller/.idea/.gitignore
new file mode 100644
index 0000000..c9295cc
--- /dev/null
+++ b/.idea/.idea.SPTInstaller/.idea/.gitignore
@@ -0,0 +1,13 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Rider ignored files
+/modules.xml
+/contentModel.xml
+/.idea.SPTInstaller.iml
+/projectSettingsUpdater.xml
+# Editor-based HTTP Client requests
+/httpRequests/
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml
diff --git a/.idea/.idea.SPTInstaller/.idea/.name b/.idea/.idea.SPTInstaller/.idea/.name
new file mode 100644
index 0000000..e2001da
--- /dev/null
+++ b/.idea/.idea.SPTInstaller/.idea/.name
@@ -0,0 +1 @@
+SPTInstaller
\ No newline at end of file
diff --git a/.idea/.idea.SPTInstaller/.idea/avalonia.xml b/.idea/.idea.SPTInstaller/.idea/avalonia.xml
new file mode 100644
index 0000000..400e2f0
--- /dev/null
+++ b/.idea/.idea.SPTInstaller/.idea/avalonia.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/.idea.SPTInstaller/.idea/encodings.xml b/.idea/.idea.SPTInstaller/.idea/encodings.xml
new file mode 100644
index 0000000..df87cf9
--- /dev/null
+++ b/.idea/.idea.SPTInstaller/.idea/encodings.xml
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file
diff --git a/.idea/.idea.SPTInstaller/.idea/indexLayout.xml b/.idea/.idea.SPTInstaller/.idea/indexLayout.xml
new file mode 100644
index 0000000..7b08163
--- /dev/null
+++ b/.idea/.idea.SPTInstaller/.idea/indexLayout.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/.idea.SPTInstaller/.idea/vcs.xml b/.idea/.idea.SPTInstaller/.idea/vcs.xml
new file mode 100644
index 0000000..35eb1dd
--- /dev/null
+++ b/.idea/.idea.SPTInstaller/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/SPTInstaller/CustomControls/PreCheckItem.axaml b/SPTInstaller/CustomControls/PreCheckItem.axaml
index 68e7fb3..d0b65bb 100644
--- a/SPTInstaller/CustomControls/PreCheckItem.axaml
+++ b/SPTInstaller/CustomControls/PreCheckItem.axaml
@@ -22,7 +22,7 @@
diff --git a/SPTInstaller/SPTInstaller.csproj b/SPTInstaller/SPTInstaller.csproj
index c739110..0fe4d30 100644
--- a/SPTInstaller/SPTInstaller.csproj
+++ b/SPTInstaller/SPTInstaller.csproj
@@ -9,8 +9,9 @@
icon.ico
Assets\icon.ico
Debug;Release;TEST
- 2.16
- 2.16
+ 2.17
+ 2.17
+ SPT-AKI
diff --git a/SPTInstaller/ViewModels/PreChecksViewModel.cs b/SPTInstaller/ViewModels/PreChecksViewModel.cs
index 78ef47e..1cbeee0 100644
--- a/SPTInstaller/ViewModels/PreChecksViewModel.cs
+++ b/SPTInstaller/ViewModels/PreChecksViewModel.cs
@@ -5,6 +5,8 @@ using System.Windows.Input;
using Avalonia.Controls;
using Avalonia.Threading;
using DialogHostAvalonia;
+using Gitea.Api;
+using Gitea.Client;
using ReactiveUI;
using Serilog;
using SPTInstaller.Controllers;
@@ -25,7 +27,7 @@ public class PreChecksViewModel : ViewModelBase
public ICommand DismissUpdateCommand { get; set; }
- public InstallerUpdateInfo UpdateInfo { get; set; } = new InstallerUpdateInfo();
+ public InstallerUpdateInfo UpdateInfo { get; set; } = new();
private string _installPath;
public string InstallPath
@@ -33,6 +35,14 @@ public class PreChecksViewModel : ViewModelBase
get => _installPath;
set => this.RaiseAndSetIfChanged(ref _installPath, value);
}
+
+ private string _installButtonText;
+
+ public string InstallButtonText
+ {
+ get => _installButtonText;
+ set => this.RaiseAndSetIfChanged(ref _installButtonText, value);
+ }
private bool _allowInstall;
public bool AllowInstall
@@ -61,12 +71,22 @@ public class PreChecksViewModel : ViewModelBase
get => _cacheCheckState;
set => this.RaiseAndSetIfChanged(ref _cacheCheckState, value);
}
+
+ private StatusSpinner.SpinnerState _installButtonCheckState;
+ public StatusSpinner.SpinnerState InstallButtonCheckState
+ {
+ get => _installButtonCheckState;
+ set => this.RaiseAndSetIfChanged(ref _installButtonCheckState, value);
+ }
public PreChecksViewModel(IScreen host) : base(host)
{
var data = ServiceHelper.Get();
var installer = ServiceHelper.Get();
+ InstallButtonText = "Please wait ...";
+ InstallButtonCheckState = StatusSpinner.SpinnerState.Pending;
+
if (data == null || installer == null)
{
NavigateTo(new MessageViewModel(HostScreen, Result.FromError("Failed to get required service for prechecks")));
@@ -74,6 +94,11 @@ public class PreChecksViewModel : ViewModelBase
}
data.OriginalGamePath = PreCheckHelper.DetectOriginalGamePath();
+
+ data.TargetInstallPath = Environment.CurrentDirectory;
+ InstallPath = data.TargetInstallPath;
+
+ Log.Information($"Install Path: {FileHelper.GetRedactedPath(InstallPath)}");
#if !TEST
if (data.OriginalGamePath == null)
@@ -83,11 +108,6 @@ public class PreChecksViewModel : ViewModelBase
}
#endif
- data.TargetInstallPath = Environment.CurrentDirectory;
- InstallPath = data.TargetInstallPath;
-
- Log.Information($"Install Path: {FileHelper.GetRedactedPath(InstallPath)}");
-
if (data.OriginalGamePath == data.TargetInstallPath)
{
Log.CloseAndFlush();
@@ -156,10 +176,38 @@ public class PreChecksViewModel : ViewModelBase
Task.Run(async () =>
{
+ // run prechecks
var result = await installer.RunPreChecks();
+ // check for updates
await UpdateInfo.CheckForUpdates(Assembly.GetExecutingAssembly().GetName()?.Version);
+
+ // get latest spt version
+ InstallButtonText = "Getting latest release ...";
+ InstallButtonCheckState = StatusSpinner.SpinnerState.Running;
+
+ var repo = new RepositoryApi(Configuration.Default);
+ var akiRepoReleases = await repo.RepoListReleasesAsync("SPT-AKI", "Stable-releases");
+ if (akiRepoReleases == null || akiRepoReleases.Count == 0)
+ {
+ InstallButtonText = "Could not get SPT releases from repo";
+ InstallButtonCheckState = StatusSpinner.SpinnerState.Error;
+ return;
+ }
+
+ var latestAkiRelease = akiRepoReleases.FindAll(x => !x.Prerelease)[0];
+
+ if (latestAkiRelease == null)
+ {
+ InstallButtonText = "Could not find the latest SPT release";
+ InstallButtonCheckState = StatusSpinner.SpinnerState.Error;
+ return;
+ }
+
+ InstallButtonText = $"Start Install: SPT v{latestAkiRelease.TagName}";
+ InstallButtonCheckState = StatusSpinner.SpinnerState.OK;
+
AllowDetailsButton = true;
AllowInstall = result.Succeeded;
});
diff --git a/SPTInstaller/Views/DetailedPreChecksView.axaml b/SPTInstaller/Views/DetailedPreChecksView.axaml
index 0b3c067..da142bf 100644
--- a/SPTInstaller/Views/DetailedPreChecksView.axaml
+++ b/SPTInstaller/Views/DetailedPreChecksView.axaml
@@ -24,14 +24,18 @@
Margin="5"
/>
-
+ >
+
+
+
+
+
diff --git a/SPTInstaller/Views/PreChecksView.axaml b/SPTInstaller/Views/PreChecksView.axaml
index 367e663..b527cc1 100644
--- a/SPTInstaller/Views/PreChecksView.axaml
+++ b/SPTInstaller/Views/PreChecksView.axaml
@@ -19,13 +19,18 @@
HorizontalAlignment="Center"
/>
-
+ >
+
+
+
+
+