@echo Off setlocal EnableDelayedExpansion echo. echo =========================================== echo 检查编译环境 echo =========================================== echo. cd /d "%~dp0" python --version if ERRORLEVEL 1 goto :PythonCommandError goto :CommandBuild :PythonCommandError for /f "delims=" %%i in ('REG.EXE QUERY "HKEY_LOCAL_MACHINE\SOFTWARE\Python\PythonCore\2.7\InstallPath" /VE ') do set InstallDir=%%i if "%InstallDir%" == "" goto :PythonInstallError set InstallDir=%InstallDir:~22% if not exist %InstallDir% goto :PythonInstallError goto :PathBuild :CommandBuild python PackTools\PackTools.py %1 %2 %3 %4 %5 %6 %7 %8 %9 if ERRORLEVEL 1 goto :Fail if ERRORLEVEL 2 goto :Success goto :Common :PathBuild "%InstallDir%\python.exe" PackTools\PackTools.py %1 %2 %3 %4 %5 %6 %7 %8 %9 if ERRORLEVEL 1 goto :Fail if ERRORLEVEL 2 goto :Success goto :Common :ColorTheStr >"%~2" set /p=