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

Verify actual installed V6 Excel XLSX file-picker negative path on disposable Windows without publishing private inputs

davoodmehraban89 committed Oct 19, 2026 at 19:09 UTC 4c8bd81ecac6a582389d1a3846ae29bac00544d0
1 file changed +273
.github/workflows/v6-real-installed-excel-ui-negative-once.yml new
+273
@@ -0,0 +1,273 @@
1 +name: Nonfinal V6 installed Excel XLSX native GUI negative acceptance
2 +on:
3 + push:
4 + paths:
5 + - .github/workflows/v6-real-installed-excel-ui-negative-once.yml
6 + workflow_dispatch:
7 +permissions:
8 + contents: read
9 +jobs:
10 + private-builder:
11 + runs-on: windows-2022
12 + timeout-minutes: 70
13 + steps:
14 + - name: Install Node 22
15 + uses: actions/setup-node@v4
16 + with:
17 + node-version: '22'
18 + - name: Verify private V6 builder from validated short staging path, no uploads
19 + shell: pwsh
20 + env:
21 + TF_VALIDATION_READ_TOKEN: ${{ secrets.TF_VALIDATION_READ_TOKEN }}
22 + run: |
23 + $ErrorActionPreference='Stop'
24 + if([string]::IsNullOrWhiteSpace($env:TF_VALIDATION_READ_TOKEN)){throw 'PRIVATE_READ_TOKEN_NOT_AVAILABLE'}
25 + $env:GH_TOKEN=$env:TF_VALIDATION_READ_TOKEN
26 + $private='davoodmehraban89/TreasuryFlow-Validation-Private'
27 + $branch='dev/v6-sql-editor-assertion-repair-20261017'
28 + $work=Join-Path $env:RUNNER_TEMP 'v6-protected-builder'
29 + New-Item -ItemType Directory -Path $work -Force | Out-Null
30 + $paths=@('qa/scripts/rebuild-v6-private-nonfinal-qa.ps1',
31 + 'qa/patches/v6-sql-assertion-fix.mjs',
32 + 'qa/patches/v6-add-readonly-sqlserver-adapter.mjs',
33 + 'qa/windows/v6-installed-native-gui-os-clipboard.mjs',
34 + 'qa/windows/v6-full-installed-gui-and-persistence.mjs',
35 + 'qa/windows/gui-readiness.mjs',
36 + 'qa/windows/synthetic-iban.mjs',
37 + 'qa/windows/v6-installed-excel-ui-negative-gate.mjs')
38 + foreach($path in $paths){
39 + $url="https://api.github.com/repos/$private/contents/${path}?ref=$branch"
40 + $api=Invoke-RestMethod -Uri $url -Headers @{ Authorization="Bearer $env:TF_VALIDATION_READ_TOKEN"; Accept='application/vnd.github+json'; 'User-Agent'='TreasuryFlow-private-qa' }
41 + if(!$api.content -or $api.encoding -ne 'base64'){throw 'PRIVATE_TEXT_FETCH_FAILED'}
42 + $dest=Join-Path $work $path
43 + New-Item -ItemType Directory -Path (Split-Path $dest -Parent) -Force | Out-Null
44 + [IO.File]::WriteAllBytes($dest,[Convert]::FromBase64String(($api.content -replace '\s','')))
45 + }
46 + $archive=Join-Path $work 'TreasuryFlow_Validation_Staging_20261017.zip'
47 + & gh release download validation-inputs-20261017 --repo $private --pattern TreasuryFlow_Validation_Staging_20261017.zip --dir $work *> (Join-Path $work 'release-fetch.log')
48 + if($LASTEXITCODE -ne 0){throw 'PRIVATE_RELEASE_DOWNLOAD_FAILED'}
49 + # The private read-only GitHub token is ONLY for fetching inputs.
50 + # electron-builder can infer an unintended publish/update provider
51 + # from GH_TOKEN after NSIS has otherwise successfully built.
52 + Remove-Item Env:GH_TOKEN -ErrorAction SilentlyContinue
53 + Remove-Item Env:GITHUB_TOKEN -ErrorAction SilentlyContinue
54 + Remove-Item Env:TF_VALIDATION_READ_TOKEN -ErrorAction SilentlyContinue
55 + Write-Host 'GATE_PASS_PRIVATE_DOWNLOAD_TOKEN_CLEARED_BEFORE_PACKAGING'
56 + $destination=Join-Path $work 'run-once-candidate'
57 + $privateLog=Join-Path $work 'full-builder-log-private.txt'
58 + $errors=$null
59 + $tokens=$null
60 + [void][Management.Automation.Language.Parser]::ParseFile((Join-Path $work $paths[0]),[ref]$tokens,[ref]$errors)
61 + if($errors.Count -gt 0){throw 'PRIVATE_BUILDER_POWERSHELL_PARSE_FAILED'}
62 + & pwsh -NoProfile -File (Join-Path $work $paths[0]) -SourceArchive $archive -OutputRoot $destination *> $privateLog
63 + if($LASTEXITCODE -ne 0) {
64 + $known='ORIGINAL_PRIVATE_SOURCE_HASH_MISMATCH|UNSAFE_ZIP_ENTRY_PATH|ARCHIVE_ENTRY_COUNT_LIMIT|ZIP_UNCOMPRESSED_SIZE_LIMIT|ZIP_SYMLINK_DISALLOWED|DUPLICATE_ZIP_ENTRY|EXTRACTED_REPARSE_POINT_DISALLOWED|OFFICIAL_XLSX_PACKAGE_LOCK_INTEGRITY_NOT_PINNED_TO_VERIFIED_ARCHIVE|SHEETJS_OFFICIAL_VENDOR_SHA256_MISMATCH|INITIAL_NPM_CI_FAILED|REMOVE_VULNERABLE_XLSX_FAILED|INSTALL_PINNED_OFFICIAL_XLSX_FAILED|PATCHED_LOCK_NPM_CI_FAILED|KNOWN_PRODUCTION_DEPENDENCY_ADVISORIES_REMAIN|V6_UNIT_REGRESSION_FAILED|V6_GATE_FAILED_[A-Z]+|V6_NSIS_BUILDER_FAILED|READ_ONLY_SQL_ADAPTER_PATCH_FAILED|SQL_EDITOR_TEST_PATCH_FAILED'
65 + $nsisLog=Join-Path $destination 'private-local-logs/private-nsis.log'
66 + if(Test-Path -LiteralPath $nsisLog){
67 + $nsisText=Get-Content -LiteralPath $nsisLog -Raw
68 + $knownClasses=[ordered]@{
69 + NSIS_PROCESS='(?i)makensis|nsis'
70 + NETWORK='(?i)ETIMEDOUT|ECONNRESET|socket hang up|download failed'
71 + FILE_PATH='(?i)ENOENT|not found|cannot find module'
72 + SIGNING='(?i)signing|certificate|winCodeSign'
73 + ACCESS='(?i)EPERM|EACCES|access denied'
74 + NATIVE_DEPENDENCY='(?i)node-gyp|npmRebuild|native dependency'
75 + CONFIGURATION='(?i)configuration|invalid config|schema'
76 + ASAR='(?i)asar|cannot pack'
77 + WINDOWS_PATH_LENGTH='(?i)path too long|filename too long'
78 + UNKNOWN_BUILDER_ERROR='(?i)error|failed|⨯'
79 + }
80 + $specificClasses=[ordered]@{
81 + ASAR_ENTRY_MISSING='(?i)(?:Application entry file|main entry file|entry file.*does not exist)'
82 + ELECTRON_MAIN_MISSING='(?i)(?:main\.cjs.*not found|main\.js.*not found|entrypoint.*missing)'
83 + ELECTRON_APP_PACKAGE='(?i)(?:app\.asar.*does not exist|no app\.asar|invalid app package)'
84 + FILE_ALREADY_EXISTS='(?i)(?:file already exists|EEXIST)'
85 + PATH_IS_TOO_LONG='(?i)(?:ENAMETOOLONG|path too long|filename or extension is too long)'
86 + UNRESOLVED_DEPENDENCY='(?i)(?:unresolved dependenc|missing dependenc|cannot resolve)'
87 + APP_BUILDER_EXIT='(?i)(?:exit status [0-9]+|exit code [0-9]+|errorOut=)'
88 + CODE_SIGN_FAILURE='(?i)(?:failed to sign|signing failed|signtool.*error)'
89 + NSIS_MAKENSIS_FAILURE='(?i)(?:makensis.*failed|NSIS Error|failed to compile script)'
90 + INTEGRITY_FAILURE='(?i)(?:integrity checksum failed|incorrect integrity|checksum mismatch)'
91 + ZIP_FAILURE='(?i)(?:7zip.*error|failed to extract|archive corrupted)'
92 + RUNNER_RESOURCE_FAILURE='(?i)(?:out of memory|ENOMEM|disk full|ENOSPC)'
93 + WINDOWS_PROCESS_FAILURE='(?i)(?:spawn.*fail|The system cannot find|CreateProcess)'
94 + PACKAGING_REBUILD_FAILURE='(?i)(?:failed to rebuild|rebuilding native|node-gyp failed)'
95 + AFTER_PACK_HOOK_FAILURE='(?i)(?:afterPack.*fail|afterSign.*fail)'
96 + PUBLISH_FAILURE='(?i)(?:publish.*fail|upload.*fail)'
97 + }
98 + foreach($name in $specificClasses.Keys){
99 + Write-Host ('PRIVATE_QA_NSIS_SPECIFIC_'+$name+'='+[bool]($nsisText -match $specificClasses[$name]))
100 + }
101 + $releasePath=Join-Path $env:RUNNER_TEMP 'private-stage/release'
102 + $binCount=@(Get-ChildItem -LiteralPath $releasePath -File -Filter '*.exe' -ErrorAction SilentlyContinue).Count
103 + Write-Host ('PRIVATE_NSIS_RESULT_EXE_PRESENT='+[bool]($binCount -gt 0))
104 + $lastLineCount=@($nsisText -split '\r?\n' | Where-Object {$_ -match '(?i)error|fail|exit|throw'}).Count
105 + Write-Host ('PRIVATE_NSIS_ERROR_LIKE_LINE_COUNT='+[Math]::Min($lastLineCount,100))
106 + $shortCodes=[regex]::Matches($nsisText,'\\b(?:ERR_[A-Z0-9_]{4,64}|E(?:ACCES|PERM|NOENT|EXIST|CONNRESET|TIMEDOUT|NOTFOUND|NOSPC|NAMETOOLONG|PROTO|AI_AGAIN))\\b')
107 + $codes=@($shortCodes | ForEach-Object {$_.Value} | Select-Object -Unique | Select-Object -First 8)
108 + if($codes.Count -gt 0){Write-Host ('PRIVATE_QA_NSIS_SAFE_ERROR_CODES='+($codes -join ','))}
109 + foreach($name in $knownClasses.Keys){
110 + Write-Host ('PRIVATE_QA_NSIS_DIAGNOSTIC_'+$name+'='+[bool]($nsisText -match $knownClasses[$name]))
111 + }
112 + }
113 + $record=Get-Content $privateLog -Raw
114 + $attempts=[regex]::Matches($record,'PRIVATE_QA_PHASE=NSIS_DIRECT_(?:BINARY_RETRY|RETRY_SUCCEEDED|RETRY_FAILED)')
115 + Write-Host ('PRIVATE_QA_DIRECT_RETRY_MARKERS='+($attempts.Count))
116 + foreach($a in $attempts){Write-Host ('PRIVATE_QA_ATTEMPT='+$a.Value)}
117 + if(Test-Path -LiteralPath $nsisLog){
118 + # Preapproved generic English vocabulary only. No raw log,
119 + # private paths, URLs, source lines, values, IDs or credentials.
120 + $allowed=@('error','failed','failure','fatal','exit','code','status','process','terminated',
121 + 'command','cannot','could','not','find','found','missing','invalid','unrecognized',
122 + 'unexpected','argument','unknown','required','option','file','directory','path',
123 + 'package','module','dependency','native','rebuild','electron','builder','nsis',
124 + 'sign','signing','certificate','installer','installation','configuration',
125 + 'config','schema','archive','asar','version','runtime','windows','win','setup',
126 + 'permission','access','denied','exception','execution','message','warning',
127 + 'artifact','output','input','executable','target','release','publish',
128 + 'upload','download','network','timeout','certificate','digest','hash',
129 + 'checksum','integrity','symlink','extract','copy','rename','remove',
130 + 'read','write','create','open','close','unsupported','environment',
131 + 'value','type','object','null','undefined','function','property','properties',
132 + 'string','number','boolean','parse','syntax','operation','system','is',
133 + 'was','with','at','to','in','from','for','and','or','of','on','the','a','an',
134 + 'after','before','during','while','as','due','because','by','already',
135 + 'exists','cannot','isnt','doesnt','trying','use','using','please',
136 + 'cannot','build','building','built','pack','packaging','unpack',
137 + 'not','proper','invalid','has','have','had','failed','called')
138 + $failureLines=@($nsisText -split '\r?\n' | Where-Object {$_ -match '(?i)error|failed|exception|⨯'})
139 + $terminalLine=if($failureLines.Count -gt 0){[string]$failureLines[$failureLines.Count-1]}else{''}
140 + $words=@([regex]::Matches($terminalLine,'[A-Za-z]{2,24}') |
141 + ForEach-Object {$_.Value.ToLowerInvariant()} |
142 + Where-Object {$allowed -contains $_} | Select-Object -First 30)
143 + Write-Host ('PRIVATE_QA_SAFE_ERROR_WORDS='+($words -join '_'))
144 + }
145 + $phases=[regex]::Matches($record,'PRIVATE_QA_PHASE=[A-Z_]+')
146 + $lastPhase=if($phases.Count -gt 0){$phases[$phases.Count-1].Value}else{'PRIVATE_QA_PHASE=BEFORE_ARCHIVE_PREFLIGHT'}
147 + Write-Host ('DIAGNOSTIC_LAST_VERIFIED_PHASE='+$lastPhase)
148 + $match=[regex]::Match($record,$known)
149 + $code=if($match.Success){$match.Value}else{'PRIVATE_BUILD_FAILED_DETAILS_RETAINED_ONLY_ON_EPHEMERAL_WINDOWS_RUNNER'}
150 + try {
151 + $probeRelease=Join-Path $env:RUNNER_TEMP 'private-stage/release'
152 + $cand=@(Get-ChildItem -LiteralPath $probeRelease -Filter 'TreasuryFlow*.exe' -File -ErrorAction SilentlyContinue | Where-Object {$_.Length -gt 1000000})
153 + Write-Host ('DIAGNOSTIC_INSTALLER_COUNT='+$cand.Count)
154 + if($cand.Count -eq 1){
155 + $testHome=Join-Path $env:RUNNER_TEMP 'v6-diagnostic-installed'
156 + $testData=Join-Path $env:RUNNER_TEMP 'v6-diagnostic-data'
157 + New-Item -ItemType Directory -Path $testData -Force | Out-Null
158 + $p=Start-Process -FilePath $cand[0].FullName -ArgumentList @('/S',('/D='+$testHome)) -PassThru
159 + if(!$p.WaitForExit(120000)){try{$p.Kill()}catch{};throw 'TEST_INSTALL_TIMED_OUT'}
160 + if($p.ExitCode -ne 0){throw 'TEST_INSTALL_EXIT'}
161 + $installedExe=@(Get-ChildItem -LiteralPath $testHome -Recurse -File -Filter 'TreasuryFlow.exe' -ErrorAction SilentlyContinue)
162 + if($installedExe.Count -ne 1){throw 'TEST_EXE_NOT_INSTALLED'}
163 + Write-Host 'PROBE_PASS_NSIS_INSTALL_WHILE_PACKAGER_EXIT_NONZERO'
164 + & node (Join-Path $work $paths[3]) $installedExe[0].FullName $testData *> (Join-Path $work 'private-gui-probe.log')
165 + if($LASTEXITCODE -eq 0){
166 + $data=Get-Content (Join-Path $testData 'private-gui-report.json') -Raw | ConvertFrom-Json
167 + if($data.status -eq 'PASS' -and $data.osClipboard){
168 + Write-Host 'PROBE_PASS_REAL_WINDOWS_CLIPBOARD_WHILE_PACKAGER_EXIT_NONZERO'
169 + }else{Write-Host 'PROBE_FAIL_GUI_ASSERTION'}
170 + }else{Write-Host 'PROBE_FAIL_GUI_EXECUTION'}
171 + $un=@(Get-ChildItem -LiteralPath $testHome -Recurse -File -Filter 'Uninstall*.exe' -ErrorAction SilentlyContinue)
172 + if($un.Count -eq 1){
173 + $up=Start-Process -FilePath $un[0].FullName -ArgumentList '/S' -PassThru
174 + if($up.WaitForExit(90000) -and $up.ExitCode -eq 0){Write-Host 'PROBE_PASS_NSIS_UNINSTALL_WHILE_PACKAGER_EXIT_NONZERO'}
175 + }
176 + }
177 + }catch{
178 + Write-Host 'PROBE_FAIL_DIAGNOSTIC_INSTALL_OR_GUI'
179 + }
180 + throw $code
181 + }
182 + $deliverables=Join-Path $destination 'PRIVATE_QA_DELIVERABLES'
183 + $proof=Get-Content (Join-Path $deliverables 'NONFINAL_QA_SHA256_MANIFEST.json') -Raw | ConvertFrom-Json
184 + $source=Join-Path $deliverables 'TreasuryFlow_V6_1.0.1_Patched_NONFINAL_QA_Source.zip'
185 + $exe=Join-Path $deliverables 'TreasuryFlow_V6_1.0.1_Patched_NONFINAL_QA_Setup.exe'
186 + if(!(Test-Path $source) -or !(Test-Path $exe) -or $proof.finalRelease -ne $false -or $proof.v7FinalAccepted -ne $false -or $proof.productionNpmVulnerabilities -ne 0){throw 'NONFINAL_MANIFEST_POLICY_FAILED'}
187 + if((Get-FileHash $source -Algorithm SHA256).Hash -ne $proof.patchedSourceSha256 -or
188 + (Get-FileHash $exe -Algorithm SHA256).Hash -ne $proof.patchedInstallerSha256){throw 'NONFINAL_MANIFEST_DIGEST_MISMATCH'}
189 + Write-Host 'PRIVATE_V6_PATCHED_SOURCE_AND_WINDOWS_SETUP_BUILD_PASS'
190 + Write-Host 'PRIVATE_V6_NPM_SECURITY_TEST_TYPECHECK_LINT_BUILD_SMOKE_PASS'
191 + Write-Host 'NO_SOURCE_OR_BINARY_UPLOADED_TO_PUBLIC_ARTIFACTS'
192 + # Replay installed native GUI/clipboard acceptance on this exact built EXE.
193 + & node --check (Join-Path $work $paths[3])
194 + if($LASTEXITCODE -ne 0){throw 'INSTALLED_GUI_HARNESS_SYNTAX_FAILED'}
195 + $env:BANK_ADAPTER_MODE='disabled'
196 + $env:TREASURYFLOW_DESKTOP_LOCAL='1'
197 + $env:TREASURYFLOW_ENABLE_MAYAN_EXTERNAL_READ='0'
198 + $env:TREASURYFLOW_MAYAN_ENABLE_EXTERNAL_READ='0'
199 + $env:TREASURYFLOW_ENABLE_SQL_LAB='0'
200 + $isolation=Join-Path $env:RUNNER_TEMP 'v6-gui-test-data'
201 + $installDir=Join-Path $env:RUNNER_TEMP 'TreasuryFlow-V6-Isolated-Installed'
202 + New-Item -ItemType Directory -Path $isolation -Force | Out-Null
203 + $install=Start-Process -FilePath $exe -ArgumentList @('/S',('/D='+$installDir)) -PassThru
204 + if(!$install.WaitForExit(240000)){try{$install.Kill()}catch{};throw 'V6_NSIS_INSTALL_TIMEOUT'}
205 + if($install.ExitCode -ne 0){throw 'V6_NSIS_NONZERO_EXIT'}
206 + $installed=@(Get-ChildItem -LiteralPath $installDir -Recurse -Filter 'TreasuryFlow.exe' -File -ErrorAction SilentlyContinue)
207 + if($installed.Count -ne 1){throw 'INSTALLED_V6_EXE_NOT_UNIQUE'}
208 + Write-Host 'GATE_PASS_SAME_ARTIFACT_NSIS_INSTALL'
209 + $guiLog=Join-Path $work 'private-installed-gui-log.txt'
210 + & node (Join-Path $work $paths[3]) $installed[0].FullName $isolation *> $guiLog
211 + if($LASTEXITCODE -ne 0){
212 + $guiRecord=Get-Content (Join-Path $isolation 'private-gui-report.json') -Raw | ConvertFrom-Json
213 + $safe=$guiRecord.failure -replace '[^A-Z0-9_ ]',''
214 + if(!$safe){$safe='UNKNOWN'}
215 + throw ('V6_SAME_ARTIFACT_INSTALLED_GUI_FAILED_'+$safe)
216 + }
217 + $guiRecord=Get-Content (Join-Path $isolation 'private-gui-report.json') -Raw | ConvertFrom-Json
218 + if($guiRecord.status -ne 'PASS' -or !$guiRecord.osClipboard -or !$guiRecord.bankDisabled -or
219 + !$guiRecord.copyButton -or !$guiRecord.writable -or !$guiRecord.select){throw 'V6_SAME_ARTIFACT_GUI_REPORT_FAIL'}
220 + Write-Host 'GATE_PASS_SAME_ARTIFACT_INSTALLED_WINDOWS_OS_CLIPBOARD'
221 + # Independently exercise real installed Electron 10-route navigation,
222 + # three synthetic actions, restart persistence and audit on same EXE.
223 + & node --check (Join-Path $work $paths[4])
224 + if($LASTEXITCODE -ne 0){throw 'INSTALLED_10_ROUTE_HARNESS_SYNTAX_FAILED'}
225 + $uat=Join-Path $env:RUNNER_TEMP 'v6-full-native-uat'
226 + New-Item -ItemType Directory -Path $uat -Force | Out-Null
227 + & node (Join-Path $work $paths[4]) $installed[0].FullName $uat *> (Join-Path $work 'private-native-10route-uat.log')
228 + $uatReportFile=Join-Path $uat 'treasuryflow-native-gui.json'
229 + if(!(Test-Path -LiteralPath $uatReportFile)){throw 'INSTALLED_10_ROUTE_UAT_REPORT_MISSING'}
230 + $uatReport=Get-Content -LiteralPath $uatReportFile -Raw | ConvertFrom-Json
231 + if($LASTEXITCODE -ne 0 -or $uatReport.outcome -ne 'REAL_INSTALLED_ELECTRON_GUI_PASS' -or
232 + $uatReport.visitedRoutes.Count -ne 10 -or !$uatReport.syntheticAccount -or
233 + !$uatReport.syntheticBeneficiary -or !$uatReport.syntheticDraft -or
234 + !$uatReport.durableData -or !$uatReport.auditPersisted -or !$uatReport.appReopened){
235 + $safeStage=[string]$uatReport.stage -replace '[^a-zA-Z0-9_-]',''
236 + throw ('V6_SAME_ARTIFACT_NATIVE_UAT_FAILED_AT_'+$safeStage)
237 + }
238 + Write-Host 'GATE_PASS_SAME_ARTIFACT_INSTALLED_10_ROUTES_3_SYNTHETIC_ACTIONS_RESTART_AUDIT'
239 +
240 + # Separate Excel GUI QA, using a known-invalid synthetic XLSX in the
241 + # actual installed Electron file-picker. Neither source nor output
242 + # nor generated workbook is uploaded to this public repository.
243 + & node --check (Join-Path $work $paths[7])
244 + if($LASTEXITCODE -ne 0){throw 'XLSX_GUI_HARNESS_SYNTAX_INVALID'}
245 + $excelPrivate=Join-Path $env:RUNNER_TEMP 'v6-excel-negative'
246 + New-Item -ItemType Directory -Path $excelPrivate -Force | Out-Null
247 + & node (Join-Path $work $paths[7]) $installed[0].FullName (Join-Path $env:RUNNER_TEMP 'private-stage') $excelPrivate *> (Join-Path $work 'xlsx-installed-gui-private.log')
248 + $excelReportPath=Join-Path $excelPrivate 'private-xlsx-gui-report.json'
249 + if(!(Test-Path -LiteralPath $excelReportPath)){throw 'XLSX_GUI_REPORT_NOT_CREATED'}
250 + $excelReport=Get-Content -LiteralPath $excelReportPath -Raw | ConvertFrom-Json
251 + if($LASTEXITCODE -ne 0 -or $excelReport.status -ne 'PASS_NATIVE_FILE_PICKER_ONLY' -or
252 + !$excelReport.fileSelected -or !$excelReport.bankDisabled -or !$excelReport.realElectron){
253 + $stageText=[string]$excelReport.stage -replace '[^A-Z0-9_ ]',''
254 + throw ('XLSX_NATIVE_GUI_NEGATIVE_FAILED_AT_'+$stageText)
255 + }
256 + Write-Host 'GATE_PASS_SAME_ARTIFACT_REAL_ELECTRON_XLSX_FILE_INPUT'
257 + Write-Host 'GATE_PASS_INVALID_XLSX_NOT_IMPORTED_AUTOMATICALLY'
258 + Write-Host 'BLOCKED_EXCEL_GUI_POSITIVE_IMPORT_EXPORT_NOT_VERIFIED'
259 + $uninstall=@(Get-ChildItem -LiteralPath $installDir -Recurse -File -ErrorAction SilentlyContinue |
260 + Where-Object {$_.Name -match '^uninstall.*[.]exe$'})
261 + if($uninstall.Count -ne 1){throw 'V6_NSIS_UNINSTALLER_NOT_FOUND'}
262 + $uninstallProcess=Start-Process -FilePath $uninstall[0].FullName -ArgumentList '/S' -PassThru
263 + if(!$uninstallProcess.WaitForExit(90000)){try{$uninstallProcess.Kill()}catch{};throw 'V6_UNINSTALL_TIMEOUT'}
264 + if($uninstallProcess.ExitCode -ne 0){throw 'V6_UNINSTALL_NONZERO'}
265 + for($i=0;$i -lt 90;$i++){
266 + $remaining=@(Get-ChildItem -LiteralPath $installDir -Recurse -File -Filter 'TreasuryFlow.exe' -ErrorAction SilentlyContinue)
267 + if($remaining.Count -eq 0){break}
268 + Start-Sleep -Seconds 1
269 + }
270 + if($remaining.Count -gt 0){throw 'V6_UNINSTALL_LEFT_BINARY'}
271 + Write-Host 'GATE_PASS_SAME_ARTIFACT_NSIS_UNINSTALL'
272 + Write-Host 'V6_NONFINAL_PRIVATE_QA_10_PLUS_GATES_FULL_PASS'
273 +