修复服务管理
This commit is contained in:
14
服务管理.bat
14
服务管理.bat
@@ -27,14 +27,18 @@ if not exist "%NSSM_EXE%" (
|
|||||||
)
|
)
|
||||||
|
|
||||||
REM 检查虚拟环境
|
REM 检查虚拟环境
|
||||||
|
set "PYTHON_PATH="
|
||||||
if exist ".venv\Scripts\python.exe" (
|
if exist ".venv\Scripts\python.exe" (
|
||||||
set PYTHON_PATH=%cd%\.venv\Scripts\python.exe
|
set "PYTHON_PATH=%cd%\.venv\Scripts\python.exe"
|
||||||
) else (
|
) else (
|
||||||
for /f "delims=" %%i in ('where python') do (
|
for /f "delims=" %%i in ('where python 2^>nul') do (
|
||||||
set PYTHON_PATH=%%i
|
if not defined PYTHON_PATH set "PYTHON_PATH=%%i"
|
||||||
goto :found_python
|
)
|
||||||
|
if not defined PYTHON_PATH (
|
||||||
|
echo [错误] 未找到 Python,请先安装 Python 或创建虚拟环境
|
||||||
|
pause
|
||||||
|
exit /b 1
|
||||||
)
|
)
|
||||||
:found_python
|
|
||||||
)
|
)
|
||||||
|
|
||||||
echo ========================================
|
echo ========================================
|
||||||
|
|||||||
Reference in New Issue
Block a user