Add script for installing osu!
This commit is contained in:
parent
7437b99c0f
commit
1f41450a0a
2 changed files with 14 additions and 1 deletions
|
@ -34,4 +34,5 @@ function Restore-PersonalApps([Context] $context) {
|
|||
Restore-TmNations $context;
|
||||
Restore-TmUnited $context;
|
||||
Restore-ManiaPlanet $context;
|
||||
Restore-Osu $context;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue