Refactor reWASD download for new website

This commit is contained in:
Manuel Thalmann 2024-09-26 04:09:49 +02:00
parent 05afb80c6d
commit 270eca903e

View file

@ -34,7 +34,13 @@ param(
-Installer {
Write-Host "Downloading reWASD…";
$dir = New-TemporaryDirectory;
$file = Start-BrowserDownload -URL "https://rewasd.com/" -ButtonSelector 'a.btn-default[href="#"]' -OutDir $dir -Timeout 1;
Import-BrowserAutomation;
$file = Start-BrowserDownload `
-URL "https://rewasd.com/" `
-ButtonSelector ([OpenQA.Selenium.By]::XPath('//nav[contains(@class, "navbar")]//a[contains(@class, "btn-outline-default")][normalize-space(text()) = "Download"]')) `
-OutDir $dir `
-Timeout 1;
Write-Host "Installing reWASD…";
Start-Process -Wait -FilePath $($file.FullName) -ArgumentList "/S";