PortValhalla/scripts/Windows/Software/osu!lazer/Manage.ps1

27 lines
1 KiB
PowerShell
Raw Normal View History

2023-06-07 18:24:43 +00:00
. "$PSScriptRoot/../../Scripts/Context.ps1";
2023-06-08 00:28:33 +00:00
$null = New-Module {
$path = "$env:APPDATA/osu";
$softwareName = "osu!lazer";
2023-06-30 10:19:54 +00:00
function Backup-OsuLazer([Context] $context) {
Write-Host "Backing up osu!lazer";
2023-06-08 00:28:33 +00:00
$context.Backup($path, $context.SoftwareArchive($softwareName), @("-i@`"$PSScriptRoot/include.txt`"", "-i!*.realm", "-i!*.db"));
}
2023-07-02 13:12:56 +00:00
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;
2023-07-02 21:31:56 +00:00
Remove-Item "~\Desktop\*osu*";
2023-07-02 13:12:56 +00:00
Pop-Location;
Remove-Item -Recurse $tempDir;
}
2023-06-07 18:24:43 +00:00
}