2024-08-08 02:36:35 +00:00
|
|
|
param(
|
|
|
|
$Action,
|
|
|
|
[hashtable] $Arguments
|
|
|
|
)
|
|
|
|
|
|
|
|
|
2024-09-03 10:02:09 +00:00
|
|
|
& {
|
|
|
|
param($Parameters)
|
|
|
|
. "$PSScriptRoot/../../Scripts/Restoration.ps1";
|
|
|
|
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
|
|
|
|
. "$PSScriptRoot/../../../Common/Scripts/System.ps1";
|
|
|
|
$path = "$HOME/Documents/TrackMania";
|
2024-08-08 02:36:35 +00:00
|
|
|
|
2024-09-03 10:02:09 +00:00
|
|
|
Start-SoftwareInstaller @Parameters `
|
|
|
|
-Installer {
|
|
|
|
$file = "TmUnitedForever.exe";
|
|
|
|
$dir = New-TemporaryDirectory;
|
2024-08-08 02:36:35 +00:00
|
|
|
|
2024-09-03 10:02:09 +00:00
|
|
|
foreach ($feature in @("DirectPlay", "NetFx3")) {
|
|
|
|
if ((Get-WindowsOptionalFeature -Online -FeatureName $feature).State -ne "Enabled") {
|
|
|
|
Write-Information "Enabling the ``$feature`` feature…";
|
|
|
|
choco install --source windowsFeatures -y $feature;
|
|
|
|
}
|
|
|
|
}
|
2024-08-08 02:36:35 +00:00
|
|
|
|
2024-09-03 10:02:09 +00:00
|
|
|
$null = Push-Location $dir;
|
|
|
|
Write-Host "Downloading TrackMania United Forever…";
|
|
|
|
Invoke-WebRequest "http://files.trackmaniaforever.com/tmunitedforever_setup.exe" -OutFile "$file";
|
2024-08-08 02:36:35 +00:00
|
|
|
|
2024-09-03 10:02:09 +00:00
|
|
|
Write-Host "Starting installation…";
|
|
|
|
Start-Process -Wait -FilePath $file -ArgumentList "/Silent";
|
|
|
|
Remove-DesktopIcon "*TmUnitedForever*";
|
|
|
|
$null = Pop-Location;
|
2024-08-08 02:36:35 +00:00
|
|
|
|
2024-09-03 10:02:09 +00:00
|
|
|
Remove-Item -Recurse $dir;
|
|
|
|
} `
|
|
|
|
-UserBackup {
|
|
|
|
param([hashtable] $Arguments)
|
|
|
|
Add-BackupArtifacts -User $Arguments.Name -Source $path -Path "TmUnitedForever" `
|
|
|
|
-Include @(
|
|
|
|
"ChallengeMusics",
|
|
|
|
"MediaTracker",
|
|
|
|
"MenuMusics",
|
|
|
|
"Scores",
|
|
|
|
"Skins",
|
|
|
|
"Tracks"
|
|
|
|
);
|
|
|
|
} `
|
|
|
|
-UserConfigurator {
|
|
|
|
param([hashtable] $Arguments)
|
|
|
|
Expand-BackupArtifacts -User $Arguments.Name -Path "TmUnitedForever" -Target $path;
|
|
|
|
};
|
|
|
|
} $PSBoundParameters;
|