feat(gameboot-windows): add support for installers.json and Install-Games.ps1 deployment

Extend the file deployment loop to include installers.json and Install-Games.ps1 files. Add conditional path validation before copying to gracefully handle missing files instead of failing on non-existent paths.
This commit is contained in:
2026-07-08 03:37:31 +02:00
parent afe884b9e4
commit a1be0e6d49
@@ -44,8 +44,9 @@ if ($pwdRequired -and -not $PSBoundParameters.ContainsKey('Password')) {
# --- Deploiement des scripts + durcissement ACL (exe potentiellement lance ELEVE) ---
$dest = Join-Path $Env:ProgramData 'FWS'
New-Item -ItemType Directory -Force -Path $dest | Out-Null
foreach ($f in 'fws-return.ps1','fws-play.ps1','games.json') {
Copy-Item (Join-Path $PSScriptRoot $f) $dest -Force
foreach ($f in 'fws-return.ps1','fws-play.ps1','games.json','installers.json','Install-Games.ps1') {
$src = Join-Path $PSScriptRoot $f
if (Test-Path $src) { Copy-Item $src $dest -Force }
}
# SYSTEM + Administrateurs = plein controle ; Utilisateurs = lecture seule ; heritage retire.
& icacls $dest /inheritance:r /grant:r 'SYSTEM:(OI)(CI)F' '*S-1-5-32-544:(OI)(CI)F' '*S-1-5-32-545:(OI)(CI)RX' | Out-Null