Add a script for installing TrackMania United
This commit is contained in:
parent
a8d55ccd64
commit
64cd0adf85
2 changed files with 28 additions and 0 deletions
|
@ -32,4 +32,5 @@ function Restore-PersonalApps([Context] $context) {
|
||||||
Restore-Git $context;
|
Restore-Git $context;
|
||||||
Restore-LogitechGHUB $context;
|
Restore-LogitechGHUB $context;
|
||||||
Restore-TmNations $context;
|
Restore-TmNations $context;
|
||||||
|
Restore-TmUnited $context;
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,4 +8,31 @@ $null = New-Module {
|
||||||
Write-Host "Backing up TrackMania United Forever";
|
Write-Host "Backing up TrackMania United Forever";
|
||||||
$context.Backup($path, $context.SoftwareArchive($softwareName), @("-i@`"$PSScriptRoot/include.txt`""));
|
$context.Backup($path, $context.SoftwareArchive($softwareName), @("-i@`"$PSScriptRoot/include.txt`""));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function Restore-TmUnited([Context] $context) {
|
||||||
|
$feature = "DirectPlay";
|
||||||
|
Write-Host "Restoring TrackMania United Forever";
|
||||||
|
|
||||||
|
if (-not (Get-WindowsOptionalFeature -Online -FeatureName $feature).State) {
|
||||||
|
Enable-WindowsOptionalFeature -Online -FeatureName $feature;
|
||||||
|
}
|
||||||
|
|
||||||
|
Write-Information "Determining location of setup file";
|
||||||
|
$exePath;
|
||||||
|
|
||||||
|
while (-not (Test-Path $exePath)) {
|
||||||
|
$exePath = Read-Host "Please drag'n'drop the setup file here or type the absolute path to the file";
|
||||||
|
|
||||||
|
if (-not (Test-Path $exePath)) {
|
||||||
|
Write-Error "A file at the specified path could not be found.";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Write-Information "Installing TrackMania United Forever";
|
||||||
|
Start-Process -Wait -FilePath $exePath -ArgumentList @("/Silent");
|
||||||
|
Write-Information "Removing desktop icon";
|
||||||
|
Remove-Item "$env:PUBLIC\Desktop\*TmUnitedForever*";
|
||||||
|
Write-Information "Restoring files";
|
||||||
|
$context.Restore($context.SoftwareArchive($softwareName), $path);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue