diff --git a/service.bat b/service.bat index 58d0604..4a1b05c 100644 --- a/service.bat +++ b/service.bat @@ -33,7 +33,9 @@ if "%1"=="admin" ( echo Started with admin rights ) else ( + call :check_extracted call :check_command powershell + echo Requesting admin rights... powershell -Command "Start-Process 'cmd.exe' -ArgumentList '/c \"\"%~f0\" admin\"' -Verb RunAs" exit @@ -859,4 +861,16 @@ if %errorLevel% neq 0 ( pause exit /b 1 ) +exit /b 0 + +:check_extracted +set "extracted=1" + +if not exist "%~dp0bin\" set "extracted=0" + +if "%extracted%"=="0" ( + call :PrintRed "Zapret must be extracted from archive first" + pause + exit +) exit /b 0 \ No newline at end of file