From 11025c36fe55d6161bfd3907e3e21bedbf1545ea Mon Sep 17 00:00:00 2001 From: anthroposcene Date: Wed, 29 Apr 2026 02:52:14 -0700 Subject: [PATCH] Update run.bat --- run.bat | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/run.bat b/run.bat index 7eb4026..06de423 100644 --- a/run.bat +++ b/run.bat @@ -4,17 +4,18 @@ cd /d "%~dp0" REM -------- MasterHttpRelayVPN one-click launcher (Windows) -------- REM Creates a local virtualenv, installs deps, runs the setup wizard -REM if needed, then starts the proxy. +REM if needed, then starts the proxy. Also checks and installs CA cert +REM if not already trusted. set "VENV_DIR=.venv" set "PY=" where py >nul 2>&1 -if %errorlevel%==0 ( +if !errorlevel!==0 ( set "PY=py -3" ) else ( where python >nul 2>&1 - if %errorlevel%==0 ( + if !errorlevel!==0 ( set "PY=python" ) ) @@ -51,10 +52,29 @@ if errorlevel 1 ( ) ) +if not exist "config.json" ( + echo [*] No config.json found — launching setup wizard ... + "%VPY%" setup.py + if errorlevel 1 ( + echo [X] Setup cancelled. + pause + exit /b 1 + ) +) + +REM -------- Check for uninstall flag -------- +echo %* | findstr /C:"--uninstall-cert" >nul +if not errorlevel 1 ( + echo [*] Uninstalling CA certificate ... + "%VPY%" main.py --uninstall-cert + exit /b %errorlevel% +) + + echo. echo [*] Starting mhr-cfw ... echo. "%VPY%" main.py %* set "RC=%errorlevel%" if not "%RC%"=="0" pause -exit /b %RC% +exit /b %RC% \ No newline at end of file