From e01729554b67d0a12adee02a49dcd5db06af7f5f Mon Sep 17 00:00:00 2001 From: "waffle.lord" Date: Sun, 14 May 2023 22:35:06 -0400 Subject: [PATCH] stuff --- SPTInstaller/Controllers/InstallController.cs | 8 +- .../ProgressableTaskList.axaml.cs | 2 +- SPTInstaller/CustomControls/TaskDetails.axaml | 3 +- .../CustomControls/TaskDetails.axaml.cs | 9 +++ SPTInstaller/Helpers/FileHelper.cs | 4 + .../Installer Tasks/CopyClientTask.cs | 7 +- SPTInstaller/Installer Tasks/DownloadTask.cs | 10 +-- .../Installer Tasks/ReleaseCheckTask.cs | 6 +- .../Installer Tasks/SetupClientTask.cs | 18 ++--- SPTInstaller/Models/InstallerTaskBase.cs | 81 +++++++++++++++---- SPTInstaller/Program.cs | 14 +++- SPTInstaller/SPTInstaller.csproj | 1 + .../ViewModels/MainWindowViewModel.cs | 5 ++ SPTInstaller/ViewModels/MessageViewModel.cs | 2 + SPTInstaller/ViewModels/PreChecksViewModel.cs | 10 ++- SPTInstaller/Views/InstallView.axaml | 1 + 16 files changed, 137 insertions(+), 44 deletions(-) diff --git a/SPTInstaller/Controllers/InstallController.cs b/SPTInstaller/Controllers/InstallController.cs index 1dddde1..9669b42 100644 --- a/SPTInstaller/Controllers/InstallController.cs +++ b/SPTInstaller/Controllers/InstallController.cs @@ -1,4 +1,5 @@ -using SharpCompress; +using Serilog; +using SharpCompress; using SPTInstaller.Interfaces; using SPTInstaller.Models; using System; @@ -22,6 +23,7 @@ namespace SPTInstaller.Controllers public async Task RunPreChecks() { + Log.Information("-<>--<>- Running PreChecks -<>--<>-"); var requiredResults = new List(); _preChecks.ForEach(x => x.IsPending = true); @@ -30,6 +32,8 @@ namespace SPTInstaller.Controllers { var result = await check.RunCheck(); + Log.Information($"PreCheck: {check.Name} ({(check.IsRequired ? "Required" : "Optional")}) -> {(result.Succeeded ? "Passed" : "Failed")}"); + if (check.IsRequired) { requiredResults.Add(result); @@ -47,6 +51,8 @@ namespace SPTInstaller.Controllers public async Task RunTasks() { + Log.Information("-<>--<>- Running Installer Tasks -<>--<>-"); + foreach (var task in _tasks) { TaskChanged?.Invoke(null, task); diff --git a/SPTInstaller/CustomControls/ProgressableTaskList.axaml.cs b/SPTInstaller/CustomControls/ProgressableTaskList.axaml.cs index 4477cd4..fbcd063 100644 --- a/SPTInstaller/CustomControls/ProgressableTaskList.axaml.cs +++ b/SPTInstaller/CustomControls/ProgressableTaskList.axaml.cs @@ -77,7 +77,7 @@ namespace SPTInstaller.CustomControls for(; TaskProgress < progress;) { - TaskProgress += 2; + TaskProgress += 1; await Task.Delay(1); } }); diff --git a/SPTInstaller/CustomControls/TaskDetails.axaml b/SPTInstaller/CustomControls/TaskDetails.axaml index b259905..b4f7186 100644 --- a/SPTInstaller/CustomControls/TaskDetails.axaml +++ b/SPTInstaller/CustomControls/TaskDetails.axaml @@ -28,11 +28,12 @@