diff --git a/install.ps1 b/install.ps1 index 71a7602..b43057d 100644 --- a/install.ps1 +++ b/install.ps1 @@ -54,6 +54,17 @@ if (-not (Test-Path (Join-Path $AppDir ".venv\Scripts\pythonw.exe"))) { & (Join-Path $AppDir ".venv\Scripts\python.exe") -m pip install --quiet --disable-pip-version-check -r (Join-Path $AppDir "requirements.txt") } +# ---------- ssh-tunnel 命令(命令行向导,与 GUI 共用配置) ---------- +$cmdPath = Join-Path $AppDir "ssh-tunnel.cmd" +if (-not (Test-Path $cmdPath)) { + Say "缺少 ssh-tunnel.cmd(仓库已更新,请重新运行安装)" +} +$userPath = [Environment]::GetEnvironmentVariable("Path", "User") +if ($userPath -notlike "*$AppDir*") { + [Environment]::SetEnvironmentVariable("Path", ($userPath.TrimEnd(";") + ";" + $AppDir), "User") + Say "已把 $AppDir 加入用户 PATH — 新开终端后可直接输入 ssh-tunnel" +} + # ---------- 桌面快捷方式 ---------- try { $ws = New-Object -ComObject WScript.Shell diff --git a/ssh-tunnel.cmd b/ssh-tunnel.cmd new file mode 100644 index 0000000..424c11f --- /dev/null +++ b/ssh-tunnel.cmd @@ -0,0 +1,6 @@ +@echo off +rem ssh-e2e CLI launcher (same wizard as Linux/macOS) +setlocal +set "HERE=%~dp0" +"%HERE%.venv\Scripts\python.exe" "%HERE%cli.py" %* +exit /b %ERRORLEVEL%