From b6f883ec38160cd99aa53b4086905bbb2092478f Mon Sep 17 00:00:00 2001 From: "waffle.lord" Date: Thu, 21 Sep 2023 10:55:25 -0400 Subject: [PATCH] update updater using download file async since a hash isn't needed and also remove new installer from cache when done updating --- SPTInstaller/Models/InstallerUpdateInfo.cs | 2 +- SPTInstaller/Resources/update.ps1 | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/SPTInstaller/Models/InstallerUpdateInfo.cs b/SPTInstaller/Models/InstallerUpdateInfo.cs index 2b6e956..bb5769c 100644 --- a/SPTInstaller/Models/InstallerUpdateInfo.cs +++ b/SPTInstaller/Models/InstallerUpdateInfo.cs @@ -88,7 +88,7 @@ public class InstallerUpdateInfo : ReactiveObject var progress = new Progress(x => DownloadProgress = (int)x); - var file = await DownloadCacheHelper.GetOrDownloadFileAsync("SPTInstller.exe", NewInstallerUrl, progress); + var file = await DownloadCacheHelper.DownloadFileAsync("SPTInstller.exe", NewInstallerUrl, progress); if (file == null || !file.Exists) { diff --git a/SPTInstaller/Resources/update.ps1 b/SPTInstaller/Resources/update.ps1 index 7e75bec..5cb9e24 100644 --- a/SPTInstaller/Resources/update.ps1 +++ b/SPTInstaller/Resources/update.ps1 @@ -22,6 +22,9 @@ Start-BitsTransfer -Source $source -Destination $destination -DisplayName "Updat Remove-Module -Name BitsTransfer +# remove the new installer from the cache folder after it is copied +Remove-Item -Path $source + Start-Process $destination Write-Host "Done" \ No newline at end of file