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

49 lines
1.5 KiB
PowerShell
Raw Permalink Normal View History

2024-09-23 01:33:17 +00:00
. "$PSScriptRoot/../../Scripts/SoftwareManagement.ps1";
2024-08-08 02:36:35 +00:00
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
2024-08-28 10:47:07 +00:00
& {
. "$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!";
2024-10-06 19:25:34 +00:00
};
2024-08-28 10:47:07 +00:00
2024-09-30 03:00:20 +00:00
Start-SoftwareInstaller @args `
2024-08-28 10:47:07 +00:00
-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
};
2024-09-30 03:00:20 +00:00
} @args;