Install missing features for TrackMania

This commit is contained in:
Manuel Thalmann 2023-07-02 18:05:06 +02:00
parent 519a52d06c
commit cfa93052f8
2 changed files with 13 additions and 8 deletions

View file

@ -10,13 +10,15 @@ $null = New-Module {
}
function Restore-TmNations([Context] $context) {
$feature = "DirectPlay";
$features = @("DirectPlay", "NetFx3");
Write-Host "Restoring TrackMania Nations Forever";
foreach ($feature in $features) {
if (-not (Get-WindowsOptionalFeature -Online -FeatureName $feature).State) {
Write-Information "Enabling the ``$feature`` feature";
Enable-WindowsOptionalFeature -Online -All -FeatureName $feature;
}
}
Write-Information "Installing TrackMania Nations Forever";
winget install --accept-source-agreements --accept-package-agreements -e --id Nadeo.TrackManiaNationsForever;

View file

@ -10,12 +10,15 @@ $null = New-Module {
}
function Restore-TmUnited([Context] $context) {
$feature = "DirectPlay";
$features = @("DirectPlay", "NetFx3");
Write-Host "Restoring TrackMania United Forever";
foreach ($feature in $features) {
if (-not (Get-WindowsOptionalFeature -Online -FeatureName $feature).State) {
Write-Information "Enabling the ``$feature`` feature";
Enable-WindowsOptionalFeature -Online -All -FeatureName $feature;
}
}
Write-Information "Determining location of setup file";
$exePath;