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,12 +10,14 @@ $null = New-Module {
}
function Restore-TmNations([Context] $context) {
$feature = "DirectPlay";
$features = @("DirectPlay", "NetFx3");
Write-Host "Restoring TrackMania Nations Forever";
if (-not (Get-WindowsOptionalFeature -Online -FeatureName $feature).State) {
Write-Information "Enabling the ``$feature`` feature";
Enable-WindowsOptionalFeature -Online -All -FeatureName $feature;
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";

View file

@ -10,11 +10,14 @@ $null = New-Module {
}
function Restore-TmUnited([Context] $context) {
$feature = "DirectPlay";
$features = @("DirectPlay", "NetFx3");
Write-Host "Restoring TrackMania United Forever";
if (-not (Get-WindowsOptionalFeature -Online -FeatureName $feature).State) {
Enable-WindowsOptionalFeature -Online -All -FeatureName $feature;
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";