diff --git a/configs/releng/airootfs/usr/local/share/fws/gameboot-windows/Install-Games.ps1 b/configs/releng/airootfs/usr/local/share/fws/gameboot-windows/Install-Games.ps1 new file mode 100644 index 0000000..375dd86 --- /dev/null +++ b/configs/releng/airootfs/usr/local/share/fws/gameboot-windows/Install-Games.ps1 @@ -0,0 +1,52 @@ +<# + Install-Games.ps1 — telecharge et lance les installeurs OFFICIELS des jeux + marques autoinstall=true dans installers.json. + + FWS ne redistribue AUCUN binaire Riot : chaque installeur est telecharge + depuis les serveurs de Riot. Riot change regulierement ses URLs -> en cas + d'echec, verifier/mettre a jour installers.json. + + NB : l'installation de Valorant n'est PAS pleinement silencieuse (Vanguard + installe un driver noyau et impose un redemarrage) : ce script LANCE + l'installeur, l'utilisateur termine les eventuelles confirmations. +#> +$ErrorActionPreference = 'Continue' +$here = Split-Path -Parent $MyInvocation.MyCommand.Path +$cfg = Join-Path $here 'installers.json' +if (-not (Test-Path $cfg)) { Write-Warning "installers.json introuvable — aucun jeu installe."; return } + +$installers = Get-Content $cfg -Raw | ConvertFrom-Json +$tmp = Join-Path $Env:TEMP 'fws-games' +New-Item -ItemType Directory -Force -Path $tmp | Out-Null + +# TLS 1.2 pour Invoke-WebRequest sur d'anciennes stacks .NET. +try { [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 } catch { } + +$names = $installers.PSObject.Properties.Name | Where-Object { $_ -notlike '_*' } +foreach ($name in $names) { + $g = $installers.$name + if (-not $g.autoinstall) { Write-Host "$name : autoinstall=false, ignore."; continue } + if (-not $g.url) { + Write-Warning "$name : aucune URL dans installers.json — installe-le manuellement." + continue + } + + $out = Join-Path $tmp $g.installer + try { + Write-Host "Telechargement de l'installeur $name ..." + Invoke-WebRequest -Uri $g.url -OutFile $out -UseBasicParsing + } catch { + Write-Warning "$name : telechargement echoue ($_). URL a verifier dans installers.json (Riot les change souvent)." + continue + } + + try { + Write-Host "Lancement de l'installeur $name ..." + if ($g.silentargs) { Start-Process $out -ArgumentList $g.silentargs -Wait } + else { Start-Process $out } + } catch { + Write-Warning "$name : lancement de l'installeur echoue ($_)." + } +} + +Write-Host "Installation des jeux lancee. Termine les eventuelles fenetres d'installation + le redemarrage impose par Vanguard."