# ============================================================================= # SimpleConvert - launch script # ============================================================================= # Starts the GUI application and prints the numeric PID as the FIRST line of # stdout (required by the test harness, which reads: $appPid = [int]$out[0]). # # A second marker line is emitted after the PID so that when stdout is captured # by PowerShell (`$out = & powershell ... launch.ps1`) the result is a string # ARRAY -- making $out[0] the full PID string. With a single line, $out would be # a scalar string and $out[0] would be only its first CHARACTER. # # Must work standalone (without build.ps1 having run in the same session). # ============================================================================= $Install = (Join-Path (Split-Path $PSScriptRoot -Parent) 'install') $Exe = Join-Path $Install 'simpleconvert.exe' # Ensure ffmpeg (the runtime conversion helper) is reachable, even if the # machine-wide PATH update from choco has not propagated to this session. $ffmpegBin = 'C:\ProgramData\chocolatey\bin' if ((Test-Path $ffmpegBin) -and ($env:PATH -notlike "*$ffmpegBin*")) { $env:PATH = "$ffmpegBin;$env:PATH" } $proc = Start-Process -FilePath $Exe -WorkingDirectory $Install -PassThru Write-Output $proc.Id Write-Output "STARTED"