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) {
|
2023-06-30 12:23:20 +00:00
|
|
|
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;
|
|
|
|
Pop-Location;
|
|
|
|
Remove-Item -Recurse $tempDir;
|
|
|
|
}
|
2023-06-07 18:24:43 +00:00
|
|
|
}
|