@echo off
setlocal EnableExtensions
set "DEST=%LOCALAPPDATA%\Programs\NavigatorSSH"
powershell -NoProfile -ExecutionPolicy Bypass -Command "$ErrorActionPreference='Stop'; $work=Join-Path $env:TEMP 'NavigatorSSH-install'; New-Item -ItemType Directory -Force -Path $work | Out-Null; $manifest=Invoke-RestMethod 'https://navicon.pro/version-navissh.json'; $zip=Join-Path $work 'navigator-ssh.zip'; & curl.exe -fL --retry 3 $manifest.windows.url -o $zip; if($LASTEXITCODE -ne 0){exit $LASTEXITCODE}; $actual=(Get-FileHash -Algorithm SHA256 $zip).Hash; if($actual -ne $manifest.windows.sha256){throw 'SHA-256 check failed'}; Expand-Archive -LiteralPath $zip -DestinationPath '%DEST%' -Force; if(-not (Test-Path (Join-Path '%DEST%' 'navissh.exe'))){throw 'navissh.exe is missing after extraction'}" || exit /b 1
echo Installed Navigator SSH to %DEST%
start "" "%DEST%\navissh.exe"
