Treasury & Bank Transfer Management System — سامانه مدیریت خزانه‌داری و حواله‌های بانکی

fix(windows): bound NSIS silent installer wait to PID with timeout

davoodmehraban89 committed Oct 17, 2026 at 00:36 UTC cf9219e4ae7fd42039d5fda2c92e890f6830af3c
1 file changed +7 -1
scripts/windows-vm-treasury-install-smoke.ps1
+7 -1
@@ -15,7 +15,13 @@ try {
15 $report.installerSha256=(Get-FileHash $setup -Algorithm SHA256).Hash
16 if(Test-Path $target){throw 'INSTALL_TEST_DIRECTORY_ALREADY_EXISTS'}
17 # NSIS silent switch; /D=<path> must be the last argument.
18 - $setupProcess=Start-Process -FilePath $setup -ArgumentList @('/S',('/D='+$target)) -PassThru -Wait
18 + $setupProcess=Start-Process -FilePath $setup -ArgumentList @('/S',('/D='+$target)) -PassThru
19 + # Wait only for the NSIS installer PID, not the entire inherited process tree.
20 + # This follows Factor-easyPro's native Windows VM lab and has a hard timeout.
21 + if(!$setupProcess.WaitForExit(90000)){
22 + try{$setupProcess.Kill()}catch{}
23 + throw 'NSIS_INSTALL_TIMEOUT'
24 + }
25 if($setupProcess.ExitCode -ne 0){throw ('NSIS_INSTALLER_NONZERO_EXIT_'+$setupProcess.ExitCode)}
26 if(!(Test-Path $target)){throw 'NSIS_INSTALL_LOCATION_NOT_CREATED'}
27 $report.silentInstall='PASS'