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