Improve reWASD installation

This commit is contained in:
Manuel Thalmann 2023-07-15 19:52:34 +02:00
parent 15977d0a97
commit 6874aed162

View file

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