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

50 lines
1.5 KiB
PowerShell

param(
$Action,
[hashtable] $Arguments
)
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
$null = New-Module {
param($Parameters)
. "$PSScriptRoot/../../Scripts/Restoration.ps1";
Export-ModuleMember -Function @();
<#
.SYNOPSIS
Gets the path to the installation directory of osu!.
#>
function Get-InstallPath {
return "$((Get-KnownFolder -SpecialFolder ProgramFilesX86).Path)/osu!";
}
Start-SoftwareInstaller @Parameters `
-Installer {
Install-ChocoPackage osu;
Remove-DesktopIcon "*osu*";
} `
-Backup {
Add-BackupArtifacts -Source (Get-InstallPath) -Path "osu!" `
-Include @(
"Screenshots",
"Skins",
"Songs",
"osu!.cfg",
"scores.db"
);
} `
-Configurator {
Expand-BackupArtifacts -Path "osu!" -Target (Get-InstallPath);
} `
-UserBackup {
param([hashtable] $Arguments)
$name = $Arguments.Name;
Add-BackupArtifacts -Source "$(Get-InstallPath)/osu!.$name.cfg" -User $name -Path "osu!/osu!.cfg";
} `
-UserConfigurator {
param([hashtable] $Arguments)
$name = $Arguments.Name;
Expand-BackupArtifacts -User $name -Path "osu!/osu!.cfg" -Target "$(Get-InstallPath)/osu!.$name.cfg";
};
} $PSBoundParameters;