Files

21 lines
2.0 KiB
PowerShell

param([ValidateSet('ui','cycle','manual')][string]$Scenario='ui',[ValidateSet('1280x720','1920x1080','2560x1440','3440x1440')][string]$Resolution='1920x1080',[switch]$Interactive)
$ErrorActionPreference='Stop'
$root=(Resolve-Path (Join-Path $PSScriptRoot '../..')).Path
$exe=Join-Path $root 'Builds/Windows/x64/ueRouge/Binaries/Win64/ueRouge.exe'
if(-not(Test-Path -LiteralPath $exe)){throw 'Archive a Windows build before acceptance'}
if(Get-Process UnrealEditor -ErrorAction SilentlyContinue){throw 'Close editor instances before isolated packaged acceptance and frame sampling'}
$stamp=Get-Date -Format 'yyyyMMdd-HHmmss'
$relative="Docs/QA/UE-Migration/Windows/$stamp-$Scenario-$Resolution"
$folder=Join-Path $root $relative
New-Item -ItemType Directory -Force $folder | Out-Null
$dataRoot=Join-Path $root "Saved/QA/Windows/$stamp-$Scenario-$Resolution"
$width,$height=$Resolution.Split('x')
$args=@('-windowed','-ForceRes',('-ResX='+$width),('-ResY='+$height),'-NoSplash','-IronsporeQA',('-IronsporeQAScenario='+$Scenario),('-IronsporeDataRoot="'+$dataRoot.Replace('\','/')+'"'),('-IronsporeQAEvidence="'+$folder.Replace('\','/')+'"'))
if(-not $Interactive){$args+='-unattended'}
$windowStyle=if($Interactive){'Normal'}else{'Hidden'}
# Visible mode is for actual keyboard/mouse and presentation checks in this interactive game.
$process=Start-Process -FilePath $exe -ArgumentList $args -WorkingDirectory (Split-Path $exe) -WindowStyle $windowStyle -PassThru
$qaMode=if($Scenario -eq 'cycle'){'Isolated scripted cycle; replenishes armor before death phase so unattended waiting does not destroy the test pilot'}else{'Isolated progress; normal armor and gameplay rules'}
[ordered]@{processId=$process.Id;executable=$exe;scenario=$Scenario;requestedResolution=$Resolution;visibleWindow=[bool]$Interactive;dataRoot=$dataRoot;evidence=$folder;environment='Packaged Windows Development; independent native process; no MCP runtime dependency';qaMode=$qaMode} | ConvertTo-Json | Set-Content -Encoding utf8 (Join-Path $folder 'launch.json')
Write-Output ($relative+' PID '+$process.Id)