From ca84ea3b665fe556017dc54b06f78b5cc389508a Mon Sep 17 00:00:00 2001 From: lijunjie Date: Tue, 24 Nov 2026 22:29:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=80=E9=94=AE=E5=AE=89=E8=A3=85.bat=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E5=89=8D=E5=8F=B0=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E5=AE=89=E8=A3=85=E3=80=81=E5=85=88=E9=80=80=E5=87=BA=E8=BF=90?= =?UTF-8?q?=E8=A1=8C=E4=B8=AD=E7=9A=84=20Squid=E3=80=81=E6=AF=8F=E6=AD=A5?= =?UTF-8?q?=E8=BE=93=E5=87=BA=E4=B8=8E=E9=94=99=E8=AF=AF=E5=8F=AF=E8=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 旧版用 start 把安装器甩到后台:窗口从头到尾没有任何输出,且未先结束 正在运行的 squid-desktop——1.7MB 主程序被进程锁住时静默安装的 NSIS 会卡在替换文件一步,现象即"双击后只剩一个空命令行提示符"。新版: 1) taskkill 先退出 Squid 并留 2 秒等句柄释放;2) 复制安装包到 %TEMP% (绕开管家对非系统盘安装器的拦截);3) 直接前台等待安装器退出并按 errorlevel 报告成败;4) 找不到安装包时给出明确错误。已端到端验证。 --- release/0.1.13/一键安装.bat | 41 +++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/release/0.1.13/一键安装.bat b/release/0.1.13/一键安装.bat index 8483770..1a9f164 100644 --- a/release/0.1.13/一键安装.bat +++ b/release/0.1.13/一键安装.bat @@ -1,4 +1,41 @@ @echo off -copy /Y "%~dp0Squid-Setup-0.1.13-win-x64.exe" "%TEMP%\Squid-Setup-0.1.13-win-x64.exe" >nul -start """ "%TEMP%\Squid-Setup-0.1.13-win-x64.exe" /S +rem Squid one-click installer. +rem Copies the setup to %TEMP% first: some security suites (e.g. PC Manager) +rem block unsigned installers launched from non-system drives. +setlocal +title Squid Setup +set "PKG=%~dp0Squid-Setup-0.1.13-win-x64.exe" +if not exist "%PKG%" ( + echo [ERROR] Setup file not found next to this script: + echo %PKG% + echo Keep this .bat in the same folder as the setup .exe. + pause + exit /b 1 +) + +echo [1/3] Stopping a running Squid if any... +taskkill /F /IM squid-desktop.exe >nul 2>&1 +rem The kill is asynchronous; give the OS a moment to release the exe lock. +ping -n 3 127.0.0.1 >nul + +echo [2/3] Copying installer to temp folder... +copy /Y "%PKG%" "%TEMP%\Squid-Setup-0.1.13-win-x64.exe" >nul +if errorlevel 1 ( + echo [ERROR] Copy to %TEMP% failed. Free up disk space or retry. + pause + exit /b 1 +) + +echo [3/3] Installing silently, please wait... +"%TEMP%\Squid-Setup-0.1.13-win-x64.exe" /S +if errorlevel 1 ( + echo [ERROR] Installer exited with code %ERRORLEVEL%. + pause + exit /b 1 +) + +echo. +echo Squid 0.1.13 installed successfully. +echo (If a previous Squid was running it was closed by this script.) +pause