2024-08-08 02:36:35 +00:00
|
|
|
param(
|
|
|
|
$Action,
|
|
|
|
[hashtable] $Arguments
|
|
|
|
)
|
|
|
|
|
2024-08-28 10:47:07 +00:00
|
|
|
& {
|
|
|
|
param($Parameters)
|
|
|
|
. "$PSScriptRoot/../../Scripts/Restoration.ps1";
|
2024-09-23 01:33:17 +00:00
|
|
|
. "$PSScriptRoot/../../Scripts/SoftwareManagement.ps1";
|
2024-08-28 10:47:07 +00:00
|
|
|
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
|
|
|
|
. "$PSScriptRoot/../../../Common/Scripts/System.ps1";
|
|
|
|
$path = "$env:AppData/osu";
|
2024-08-08 02:36:35 +00:00
|
|
|
|
2024-08-28 10:47:07 +00:00
|
|
|
Start-SoftwareInstaller @Parameters `
|
|
|
|
-UserBackup {
|
2024-09-23 00:10:42 +00:00
|
|
|
param(
|
|
|
|
[string] $Name,
|
|
|
|
[hashtable] $Arguments
|
|
|
|
)
|
|
|
|
|
|
|
|
Add-BackupArtifacts -User $Arguments.Name -Source $path -Path "$Name" `
|
2024-08-28 10:47:07 +00:00
|
|
|
-Include @(
|
|
|
|
"files",
|
|
|
|
"rulesets",
|
|
|
|
"screenshots",
|
|
|
|
"framework.ini",
|
|
|
|
"game.ini",
|
|
|
|
"input.json"
|
|
|
|
);
|
|
|
|
} `
|
|
|
|
-UserConfigurator {
|
2024-09-23 00:10:42 +00:00
|
|
|
param(
|
|
|
|
[string] $Name,
|
|
|
|
[hashtable] $Arguments
|
|
|
|
)
|
|
|
|
|
2024-08-28 10:47:07 +00:00
|
|
|
$file = "osu!lazer.exe";
|
|
|
|
$processName = "osu!";
|
|
|
|
$dir = New-TemporaryDirectory;
|
2024-08-08 02:36:35 +00:00
|
|
|
|
2024-08-28 10:47:07 +00:00
|
|
|
Push-Location $dir;
|
|
|
|
Invoke-WebRequest "https://github.com/ppy/osu/releases/latest/download/install.exe" -OutFile $file;
|
|
|
|
Start-Process -FilePath $file;
|
2024-08-08 02:36:35 +00:00
|
|
|
|
2024-08-28 10:47:07 +00:00
|
|
|
while (-not (Get-Process -ErrorAction SilentlyContinue $processName)) {
|
|
|
|
Start-Sleep 1;
|
|
|
|
}
|
2024-08-08 02:36:35 +00:00
|
|
|
|
2024-08-28 10:47:07 +00:00
|
|
|
Start-Sleep 10;
|
|
|
|
Get-Process $processName | Stop-Process -Force;
|
|
|
|
Pop-Location;
|
|
|
|
Remove-Item -Recurse $dir;
|
2024-08-08 02:36:35 +00:00
|
|
|
|
2024-08-28 10:47:07 +00:00
|
|
|
Remove-DesktopIcon "*osu*";
|
2024-09-23 00:10:42 +00:00
|
|
|
Expand-BackupArtifacts -User $Arguments.Name -Path "$Name" -Target $path;
|
2024-08-28 10:47:07 +00:00
|
|
|
};
|
|
|
|
} $PSBoundParameters;
|