45 lines
1.4 KiB
PowerShell
45 lines
1.4 KiB
PowerShell
param(
|
|
$Action,
|
|
[hashtable] $Arguments
|
|
)
|
|
|
|
|
|
& {
|
|
param($Parameters)
|
|
. "$PSScriptRoot/../../Scripts/Restoration.ps1";
|
|
. "$PSScriptRoot/../../../Common/Scripts/Software.ps1";
|
|
$path = "$HOME/Documents/TmForever";
|
|
|
|
Start-SoftwareInstaller @Parameters `
|
|
-Installer {
|
|
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;
|
|
}
|
|
}
|
|
|
|
Install-WingetPackage Nadeo.TrackManiaNationsForever;
|
|
Remove-DesktopIcon "*TmNationsForever*";
|
|
} `
|
|
-UserBackup {
|
|
param([hashtable] $Arguments)
|
|
$name = $Arguments.Name;
|
|
|
|
Add-BackupArtifacts -User $name -Source $path -Path "TmNationsForever" `
|
|
-Include @(
|
|
"ChallengeMusics",
|
|
"MediaTracker",
|
|
"MenuMusics",
|
|
"Painter",
|
|
"Scores",
|
|
"Skins",
|
|
"Tracks"
|
|
);
|
|
} `
|
|
-UserConfigurator {
|
|
param([hashtable] $Arguments)
|
|
$name = $Arguments.Name;
|
|
Expand-BackupArtifacts -User $name -Path "TmNationsForever" -Target $path;
|
|
};
|
|
} $PSBoundParameters;
|