Add a script for installing osu!lazer

This commit is contained in:
Manuel Thalmann 2023-07-02 15:12:56 +02:00
parent 1f41450a0a
commit e416032f28
2 changed files with 16 additions and 0 deletions

View file

@ -35,4 +35,5 @@ function Restore-PersonalApps([Context] $context) {
Restore-TmUnited $context;
Restore-ManiaPlanet $context;
Restore-Osu $context;
Restore-OsuLazer $context;
}

View file

@ -8,4 +8,19 @@ $null = New-Module {
Write-Host "Backing up osu!lazer";
$context.Backup($path, $context.SoftwareArchive($softwareName), @("-i@`"$PSScriptRoot/include.txt`"", "-i!*.realm", "-i!*.db"));
}
function Restore-OsuLazer([Context] $context) {
Write-Host "Restoring osu!lazer";
Write-Information "Restoring files";
$context.Restore($context.SoftwareArchive($softwareName), $path);
Write-Information "Installing osu!lazer";
$installerName = "osu!lazer.exe";
$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;
Pop-Location;
Remove-Item -Recurse $tempDir;
}
}