From c02dc0816adf3f1f76dcee6d9f6b713b73b903dd Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Wed, 12 Jul 2023 18:23:59 +0200 Subject: [PATCH] Try automating osu!lazer installer --- scripts/Windows/Software/osu!lazer/Manage.ps1 | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/scripts/Windows/Software/osu!lazer/Manage.ps1 b/scripts/Windows/Software/osu!lazer/Manage.ps1 index 43a5440c..ce5eaf85 100644 --- a/scripts/Windows/Software/osu!lazer/Manage.ps1 +++ b/scripts/Windows/Software/osu!lazer/Manage.ps1 @@ -16,10 +16,20 @@ $null = New-Module { Write-Information "Installing osu!lazer"; $installerName = "osu!lazer.exe"; + $processName = "osu!"; $tempDir = $context.GetTempDirectory(); Push-Location $tempDir; 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*"; Pop-Location; Remove-Item -Recurse $tempDir;