hypertwist/scripts/Launch-HyperTwistClassicCubePackage.ps1
2026-06-12 02:21:20 +00:00

47 lines
1.4 KiB
PowerShell

param(
[string]$PackageRoot = 'C:\HyperTwist\packaged\classic-cube',
[string]$MapUrl = '/Game/HyperTwistTraining/Maps/L_HyperTwist_ClassicTraining',
[int]$SmokeSeconds = 10,
[int]$ResX = 1600,
[int]$ResY = 900,
[switch]$KeepRunning
)
$ErrorActionPreference = 'Stop'
$CandidateExecutablePaths = @(
(Join-Path $PackageRoot 'Windows\UnrealHyperTwist.exe'),
(Join-Path $PackageRoot 'WindowsNoEditor\UnrealHyperTwist.exe'),
(Join-Path $PackageRoot 'UnrealHyperTwist.exe')
)
$ExecutablePath = $CandidateExecutablePaths | Where-Object { Test-Path $_ } | Select-Object -First 1
if ($null -eq $ExecutablePath)
{
throw "No packaged UnrealHyperTwist executable was found beneath '$PackageRoot'."
}
$ArgumentList = @(
$MapUrl,
"-ResX=$ResX",
"-ResY=$ResY",
'-windowed',
'-log'
)
Write-Host "Launching packaged classic-cube validation lane from '$ExecutablePath'..."
$Process = Start-Process -FilePath $ExecutablePath -ArgumentList $ArgumentList -PassThru
Start-Sleep -Seconds $SmokeSeconds
$Process.Refresh()
if ($Process.HasExited)
{
throw "Packaged classic-cube executable exited early with code $($Process.ExitCode)."
}
Write-Host "Packaged classic-cube smoke launch succeeded (PID $($Process.Id))."
if (-not $KeepRunning)
{
Stop-Process -Id $Process.Id -Force
Write-Host 'Stopped packaged classic-cube smoke process after successful launch validation.'
}