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;