68 lines
1.5 KiB
Batchfile
68 lines
1.5 KiB
Batchfile
|
|
@echo Off
|
|||
|
|
setlocal EnableDelayedExpansion
|
|||
|
|
|
|||
|
|
echo.
|
|||
|
|
echo ===========================================
|
|||
|
|
echo <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>뻷<EFBFBD><EBBBB7>
|
|||
|
|
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=<nul&findstr /a:%1 .* "%~2*"&del "%~2*" &&set /p=<EFBFBD><EFBFBD><nul
|
|||
|
|
echo.
|
|||
|
|
goto :eof
|
|||
|
|
|
|||
|
|
:PythonInstallError
|
|||
|
|
echo.
|
|||
|
|
echo.
|
|||
|
|
call :ColorTheStr 0C "==========================================="
|
|||
|
|
call :ColorTheStr 0C "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Python2.7δ<EFBFBD><EFBFBD>װ"
|
|||
|
|
call :ColorTheStr 0C " <20>밲װPython2.7"
|
|||
|
|
call :ColorTheStr 0C "==========================================="
|
|||
|
|
echo.
|
|||
|
|
goto :Fail
|
|||
|
|
|
|||
|
|
:Fail
|
|||
|
|
echo.
|
|||
|
|
call :ColorTheStr 0C "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><EFBFBD>"
|
|||
|
|
echo.
|
|||
|
|
goto :Exit
|
|||
|
|
|
|||
|
|
|
|||
|
|
:Success
|
|||
|
|
echo.
|
|||
|
|
call :ColorTheStr 02 "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>"
|
|||
|
|
echo.
|
|||
|
|
goto :Exit
|
|||
|
|
|
|||
|
|
:Common
|
|||
|
|
goto :Exit
|
|||
|
|
|
|||
|
|
:Exit
|