Fix: eneabledelayedexpansion for error code

This commit is contained in:
litagin02
2024-03-16 16:49:22 +09:00
parent 5eef8843cc
commit f2cc879603
4 changed files with 62 additions and 36 deletions

View File

@@ -2,6 +2,9 @@ chcp 65001 > NUL
@REM https://github.com/Zuntan03/EasyBertVits2 より引用・改変
@REM エラーコードを遅延評価するために設定
setlocal enabledelayedexpansion
@echo off
set PS_CMD=PowerShell -Version 5.1 -ExecutionPolicy Bypass
set CURL_CMD=C:\Windows\System32\curl.exe
@@ -41,7 +44,7 @@ if not exist "%PYTHON_DIR%"\ (
echo Executing: %CURL_CMD% -o python.zip https://www.python.org/ftp/python/3.10.11/python-3.10.11-embed-amd64.zip
pause
%CURL_CMD% -o python.zip https://www.python.org/ftp/python/3.10.11/python-3.10.11-embed-amd64.zip
if %errorlevel% neq 0 ( pause & exit /b %errorlevel% )
if !errorlevel! neq 0 ( pause & exit /b !errorlevel! )
echo --------------------------------------------------
echo Extracting zip...
@@ -49,7 +52,7 @@ if not exist "%PYTHON_DIR%"\ (
echo Executing: %PS_CMD% Expand-Archive -Path python.zip -DestinationPath \"%PYTHON_DIR%\"
pause
%PS_CMD% Expand-Archive -Path python.zip -DestinationPath \"%PYTHON_DIR%\"
if %errorlevel% neq 0 ( pause & exit /b %errorlevel% )
if !errorlevel! neq 0 ( pause & exit /b !errorlevel! )
echo --------------------------------------------------
echo Removing python.zip...
@@ -57,7 +60,7 @@ if not exist "%PYTHON_DIR%"\ (
echo Executing: del python.zip
pause
del python.zip
if %errorlevel% neq 0 ( pause & exit /b %errorlevel% )
if !errorlevel! neq 0 ( pause & exit /b !errorlevel! )
echo --------------------------------------------------
echo Enabling 'site' module in the embedded Python environment...
@@ -65,7 +68,7 @@ if not exist "%PYTHON_DIR%"\ (
echo Executing: %PS_CMD% "&{(Get-Content '%PYTHON_DIR%/python310._pth') -creplace '#import site', 'import site' | Set-Content '%PYTHON_DIR%/python310._pth' }"
pause
%PS_CMD% "&{(Get-Content '%PYTHON_DIR%/python310._pth') -creplace '#import site', 'import site' | Set-Content '%PYTHON_DIR%/python310._pth' }"
if %errorlevel% neq 0 ( pause & exit /b %errorlevel% )
if !errorlevel! neq 0 ( pause & exit /b !errorlevel! )
echo --------------------------------------------------
echo Installing pip and virtualenv...
@@ -73,7 +76,7 @@ if not exist "%PYTHON_DIR%"\ (
echo Executing: %CURL_CMD% -o "%PYTHON_DIR%\get-pip.py" https://bootstrap.pypa.io/get-pip.py
pause
%CURL_CMD% -o "%PYTHON_DIR%\get-pip.py" https://bootstrap.pypa.io/get-pip.py
if %errorlevel% neq 0 ( pause & exit /b %errorlevel% )
if !errorlevel! neq 0 ( pause & exit /b !errorlevel! )
echo --------------------------------------------------
echo Installing pip...
@@ -81,7 +84,7 @@ if not exist "%PYTHON_DIR%"\ (
echo Executing: "%PYTHON_CMD%" "%PYTHON_DIR%\get-pip.py" --no-warn-script-location
pause
"%PYTHON_CMD%" "%PYTHON_DIR%\get-pip.py" --no-warn-script-location
if %errorlevel% neq 0 ( pause & exit /b %errorlevel% )
if !errorlevel! neq 0 ( pause & exit /b !errorlevel! )
echo --------------------------------------------------
echo Installing virtualenv...
@@ -89,7 +92,7 @@ if not exist "%PYTHON_DIR%"\ (
echo Executing: "%PYTHON_CMD%" -m pip install virtualenv --no-warn-script-location
pause
"%PYTHON_CMD%" -m pip install virtualenv --no-warn-script-location
if %errorlevel% neq 0 ( pause & exit /b %errorlevel% )
if !errorlevel! neq 0 ( pause & exit /b !errorlevel! )
)
if not exist %VENV_DIR%\ (
@@ -99,7 +102,7 @@ if not exist %VENV_DIR%\ (
echo Executing: "%PYTHON_CMD%" -m virtualenv --copies "%VENV_DIR%"
pause
"%PYTHON_CMD%" -m virtualenv --copies "%VENV_DIR%"
if %errorlevel% neq 0 ( pause & exit /b %errorlevel% )
if !errorlevel! neq 0 ( pause & exit /b !errorlevel! )
)
echo --------------------------------------------------
@@ -108,7 +111,7 @@ echo --------------------------------------------------
echo Executing: call "%VENV_DIR%\Scripts\activate.bat"
pause
call "%VENV_DIR%\Scripts\activate.bat"
if %errorlevel% neq 0 ( pause & exit /b %errorlevel% )
if !errorlevel! neq 0 ( pause & exit /b !errorlevel! )
echo --------------------------------------------------
echo Upgrading pip...
@@ -116,7 +119,7 @@ echo --------------------------------------------------
echo Executing: python -m pip install --upgrade pip
pause
python -m pip install --upgrade pip
if %errorlevel% neq 0 ( pause & exit /b %errorlevel% )
if !errorlevel! neq 0 ( pause & exit /b !errorlevel! )
echo --------------------------------------------------
echo Completed.