mirror of
https://github.com/denuitt1/mhr-cfw.git
synced 2026-05-17 21:24:36 +03:00
Update run.bat
This commit is contained in:
@@ -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%
|
||||
Reference in New Issue
Block a user