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

53 lines
1.6 KiB
PowerShell
Raw Normal View History

2024-08-28 10:47:07 +00:00
& {
2024-11-01 12:12:16 +00:00
. "$PSScriptRoot/../../lib/Restoration.ps1";
. "$PSScriptRoot/../../lib/SoftwareManagement.ps1";
. "$PSScriptRoot/../../../lib/Software.ps1";
. "$PSScriptRoot/../../../lib/System.ps1";
2024-08-28 10:47:07 +00:00
$path = "$env:AppData/osu";
2024-08-08 02:36:35 +00:00
2024-09-30 03:00:20 +00:00
Start-SoftwareInstaller @args `
2024-08-28 10:47:07 +00:00
-UserBackup {
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",
2024-10-27 15:48:50 +00:00
"client.realm",
2024-08-28 10:47:07 +00:00
"framework.ini",
"game.ini",
"input.json"
);
} `
-UserConfigurator {
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*";
Expand-BackupArtifacts -User $Arguments.Name -Path "$Name" -Target $path;
2024-08-28 10:47:07 +00:00
};
2024-09-30 03:00:20 +00:00
} @args;