[CmdletBinding()] param([string]$InstallRoot = (Join-Path (Split-Path -Parent $PSScriptRoot) 'runtime/coordinator'), [string]$JavaHome, [switch]$OpenBrowser) $ErrorActionPreference = 'Stop' $root = [IO.Path]::GetFullPath($InstallRoot) $deployment = Get-Content -LiteralPath (Join-Path $root 'deployment.json') -Raw | ConvertFrom-Json if ($deployment.role -ne 'coordinator') { throw '页面入口需要总控部署目录。' } & (Join-Path $PSScriptRoot 'Start-Xtrh.ps1') -InstallRoot $root -JavaHome $JavaHome $url = 'http://127.0.0.1:' + $deployment.port + '/console/#receive' $page = Invoke-WebRequest -UseBasicParsing -Uri $url.Split('#')[0] -TimeoutSec 5 if ([int]$page.StatusCode -ne 200) { throw '页面未就绪,请先部署带页面的新版本。' } Write-Output ('系统融合软件:' + $url) if ($OpenBrowser) { Start-Process $url }