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

54 lines
1.5 KiB
PowerShell
Raw Normal View History

2024-08-08 02:36:35 +00:00
param(
$Action,
[hashtable] $Arguments
)
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
2024-08-28 10:47:07 +00:00
& {
param($Parameters)
. "$PSScriptRoot/../../Scripts/Restoration.ps1";
Export-ModuleMember -Function @();
2024-08-08 02:36:35 +00:00
2024-08-28 10:47:07 +00:00
$getInstallPath = {
return "$((Get-KnownFolder -SpecialFolder ProgramFilesX86).Path)/osu!";
}
Start-SoftwareInstaller @Parameters `
-Installer {
Install-ChocoPackage osu;
Remove-DesktopIcon "*osu*";
} `
-Backup {
param([string] $Name)
Add-BackupArtifacts -Source (& $getInstallPath) -Path "$Name" `
2024-08-28 10:47:07 +00:00
-Include @(
"Screenshots",
"Skins",
"Songs",
"osu!.cfg",
"scores.db"
);
} `
-Configurator {
param([string] $Name)
Expand-BackupArtifacts -Path "$Name" -Target (& $getInstallPath);
2024-08-28 10:47:07 +00:00
} `
-UserBackup {
param(
[string] $Name,
[hashtable] $Arguments
)
$user = $Arguments.Name;
Add-BackupArtifacts -Source "$(& $getInstallPath)/osu!.$user.cfg" -User $user -Path "$Name/osu!.cfg";
2024-08-28 10:47:07 +00:00
} `
-UserConfigurator {
param([hashtable] $Arguments)
$name = $Arguments.Name;
Expand-BackupArtifacts -User $name -Path "$Name/osu!.cfg" -Target "$(& $getInstallPath)/osu!.$name.cfg";
2024-08-28 10:47:07 +00:00
};
} $PSBoundParameters;