Datasets:
File size: 829 Bytes
598838a | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | <#
launch.ps1 - Starts the Cuckoo Chess GUI desktop application.
Launches the self-contained native app-image produced by build.ps1
(jpackage bundles its own Java runtime, so no external JDK is required).
Outputs ONLY the numeric PID as the first line on stdout.
#>
$ErrorActionPreference = 'Stop'
$exePath = (Join-Path (Split-Path $PSScriptRoot -Parent) 'install\CuckooChess\CuckooChess.exe')
$proc = Start-Process -FilePath $exePath -PassThru
Write-Output $proc.Id
# Emit a trailing line so that when the caller does `$out = & powershell ... launch.ps1`,
# $out is captured as an array (Object[]) and $out[0] is the full PID string.
# With a single output line PowerShell collapses $out to a scalar string, making
# $out[0] index the first CHARACTER of the PID instead of the whole number.
Write-Output ""
|