Fix WinSCPnet.dll load block and trailing-quote path bug in run.bat

- Unblock-File the extracted WinSCP files after unzip: Windows tags
  downloaded files with Mark-of-the-Web, which makes Add-Type refuse to
  load WinSCPnet.dll (FileLoadException 0x80131515) until unblocked.
- run.bat passed -EntityDir "%~dp0", but %~dp0 always ends in a trailing
  backslash. cmd's argument parser treats a lone backslash before a closing
  quote as an escaped literal quote rather than the string terminator, so
  PowerShell received the path with a stray " character baked in
  (Entities\CAMBS" instead of Entities\CAMBS), breaking Test-Path. Strip the
  trailing backslash before quoting it.
This commit is contained in:
2026-07-05 19:36:11 -05:00
parent a92dc68cb9
commit 86bbe685c7
2 changed files with 7 additions and 1 deletions
+4
View File
@@ -50,5 +50,9 @@ try {
exit 1
}
# Windows tags downloaded files as untrusted ("Mark of the Web"), which blocks
# Add-Type from loading WinSCPnet.dll later. Unblock everything we just extracted.
Get-ChildItem -Path $dest -Recurse -File | Unblock-File
Remove-Item $zip -Force
Write-Host "WinSCP ready." -ForegroundColor Green