Add script for installing osu!

This commit is contained in:
Manuel Thalmann 2023-07-02 14:42:17 +02:00
parent 7437b99c0f
commit 1f41450a0a
2 changed files with 14 additions and 1 deletions

View file

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

View file

@ -1,7 +1,7 @@
. "$PSScriptRoot/../../Scripts/Context.ps1";
$null = New-Module {
$path = "$env:LOCALAPPDATA/osu!";
$path = "$(Get-KnownFolder -SpecialFolder ProgramFilesX86)/osu!";
$softwareName = "osu!";
$genericConfigName = "osu!.User.cfg";
@ -13,4 +13,16 @@ $null = New-Module {
Write-Information "Renaming user configuration to $genericConfigName";
& 7z rn "$archive" "osu!.$env:USERNAME.cfg" $genericConfigName;
}
function Restore-Osu([Context] $context) {
Write-Host "Restoring osu!";
Write-Information "Installing osu!";
choco install -y osu;
Write-Information "Restoring files";
$context.Restore($context.SoftwareArchive($softwareName), $path);
$configName = "osu!.$env:USERNAME.cfg";
Write-Information "Renaming user configuration to $configName";
Push-Location $path;
Rename-Item $genericConfigName $configName;
}
}