Install-MxGatewayService.ps1 aborts on a fresh box under Windows PowerShell 5.1 (nssm status probe) #234
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
First PROD install 2026-11-20 (wonder-app-vp03): the dry run aborted with
ERROR: Can't open service!/Install-MxGatewayService exited 1. With$ErrorActionPreference=Stop, PS 5.1 turns nssm's expected stderr from the "does the service exist?" probe (scripts/deploy/Install-MxGatewayService.ps1 ~line 65) into a terminating error, so a first install can never pass. The staged PROD copy carries PROD-STAGE PATCH 4 (run that one native call with ErrorAction Continue and check the exit code) — scadaproj68710e5, docs/deploy/2026-11-19-prod-stage/mxgw/. Also owed: the other three PROD-STAGE patches (-WorkerExeName, File KEK, connection-string masking) and the Upgrade script START_PENDING fix. Needed before the PAR boxes get mxgw.Fixed on branch
fix/234-install-script-ps51(c1776e9e). Not merged tomainand not pushed yet.Invoke-Nssmruns the native call underErrorActionPreference=Continue(restored infinally), and the exit code decides the outcome.-WorkerExeNameparameter (defaultZB.MOM.WW.MxGateway.Worker.exe; the wonder boxes passMxGateway.Worker.exe).Secrets__MasterKey__Source=Fileplus an absoluteSecrets__MasterKey__FilePath) as an alternative toZB_SECRETS_MASTER_KEY.CONNECTIONSTRINGadded to the env mask.nssm startis called with-AllowFail, and the existing RUNNING wait decides success.Invoke-Nssm,Protect-Directory(icacls) andExport-ServiceKey(reg.exe) got the same wrapper.docs/runbooks/DeployUpgradeNssmService.mdupdated.Verification:
Test-UpgradeMxGatewayService.ps1passes 140/140.Not done: a full first install on a fresh box. Do that on the next new box. Closing.