Try automating osu!lazer installer

This commit is contained in:
Manuel Thalmann 2023-07-12 18:23:59 +02:00
parent e64de7147a
commit c02dc0816a

View file

@ -16,10 +16,20 @@ $null = New-Module {
Write-Information "Installing osu!lazer"; Write-Information "Installing osu!lazer";
$installerName = "osu!lazer.exe"; $installerName = "osu!lazer.exe";
$processName = "osu!";
$tempDir = $context.GetTempDirectory(); $tempDir = $context.GetTempDirectory();
Push-Location $tempDir; Push-Location $tempDir;
Invoke-WebRequest "https://github.com/ppy/osu/releases/latest/download/install.exe" -OutFile $installerName; Invoke-WebRequest "https://github.com/ppy/osu/releases/latest/download/install.exe" -OutFile $installerName;
Start-Process -Wait -FilePath $installerName; $process = Start-Process -FilePath $installerName;
while (-not (Get-Process -ErrorAction "SilentlyContinue" $processName)) {
Start-Sleep 1;
}
Start-Sleep 10;
Get-Process $processName | Stop-Process -Force;
Wait-Process $process;
Remove-Item "~\Desktop\*osu*"; Remove-Item "~\Desktop\*osu*";
Pop-Location; Pop-Location;
Remove-Item -Recurse $tempDir; Remove-Item -Recurse $tempDir;