diff --git a/scripts/Windows/Collections/Personal.ps1 b/scripts/Windows/Collections/Personal.ps1 index f8d77b93..9f47acaa 100644 --- a/scripts/Windows/Collections/Personal.ps1 +++ b/scripts/Windows/Collections/Personal.ps1 @@ -31,4 +31,5 @@ function Restore-PersonalApps([Context] $context) { Restore-Nextcloud $context; Restore-Git $context; Restore-LogitechGHUB $context; + Restore-TmNations $context; } diff --git a/scripts/Windows/Software/TrackMania Nations Forever/Manage.ps1 b/scripts/Windows/Software/TrackMania Nations Forever/Manage.ps1 index 3e1d8a02..7d065f1c 100644 --- a/scripts/Windows/Software/TrackMania Nations Forever/Manage.ps1 +++ b/scripts/Windows/Software/TrackMania Nations Forever/Manage.ps1 @@ -8,4 +8,17 @@ $null = New-Module { Write-Host "Backing up TrackMania Nations Forever"; $context.Backup($path, $context.SoftwareArchive($softwareName), @("-i@`"$PSScriptRoot/include.txt`"")); } + + function Restore-TmNations([Context] $context) { + $feature = "DirectPlay"; + Write-Host "Restoring TrackMania Nations Forever"; + + if (-not (Get-WindowsOptionalFeature -Online -FeatureName $feature).State) { + Enable-WindowsOptionalFeature -Online -FeatureName $feature; + } + + winget install -e --id Nadeo.TrackManiaNationsForever; + Remove-Item "$env:PUBLIC\Desktop\*TmNationsForever*"; + $context.Restore($context.SoftwareArchive($softwareName), $path); + } }