diff --git a/scripts/Windows/Software/reWASD/Manage.ps1 b/scripts/Windows/Software/reWASD/Manage.ps1 index 28460a16..d53328bb 100644 --- a/scripts/Windows/Software/reWASD/Manage.ps1 +++ b/scripts/Windows/Software/reWASD/Manage.ps1 @@ -1,5 +1,7 @@ #!/bin/pwsh . "$PSScriptRoot/../../Scripts/Context.ps1"; +. "$PSScriptRoot/../../Scripts/BrowserAutomation.ps1"; +. "$PSScriptRoot/../../Scripts/SoftwarePackage.ps1"; $null = New-Module { $path = "$env:PUBLIC/Documents/reWASD"; @@ -12,7 +14,15 @@ $null = New-Module { function Restore-reWASD([Context] $context) { Write-Host "Restoring reWASD"; - Read-Host "Please hit enter once you have installed reWASD"; + $tempDir = $context.GetTempDirectory(); + + Write-Information "Downloading reWASD"; + $file = Start-AutomatedDownload $context "https://rewasd.com/" 'a[data-event-category="Download"]' $tempDir; + + Write-Information "Installing reWASD"; + Start-Process -Wait -FilePath $file.FullName -ArgumentList "/S"; + + Write-Information "Restoring files"; $context.Restore($context.SoftwareArchive($softwareName), $path); } }