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,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";