Install missing features for TrackMania

This commit is contained in:
Manuel Thalmann 2023-07-02 18:05:06 +02:00
parent f603b690a4
commit 1b491e1d23
2 changed files with 12 additions and 7 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;