+@if not defined EDK_TOOLS_BIN (\r
+ @if exist %EDK_TOOLS_PATH%\Bin\Win32 (\r
+ @set EDK_TOOLS_BIN=%EDK_TOOLS_PATH%\Bin\Win32\r
+ ) else (\r
+ @echo.\r
+ @echo !!! ERROR !!! Cannot find BaseTools Bin Win32!!!\r
+ @echo Please check the directory %EDK_TOOLS_PATH%\Bin\Win32\r
+ @echo Or configure EDK_TOOLS_BIN env to point Win32 directory.\r
+ @echo. \r
+ @goto ExitFailure\r
+ )\r
+)\r
+@set "PATH=%EDK_TOOLS_BIN%;%PATH%"\r
+\r
+@if NOT EXIST "%EDK_TOOLS_BIN%\build.exe" @set PYTHON_BUILD=TRUE\r
+@if NOT EXIST "%EDK_TOOLS_BIN%\GenFds.exe" @set PYTHON_BUILD=TRUE\r
+@if NOT EXIST "%EDK_TOOLS_BIN%\TargetTool.exe" @set PYTHON_BUILD=TRUE\r
+@if NOT EXIST "%EDK_TOOLS_BIN%\Trim.exe" @set PYTHON_BUILD=TRUE\r
+\r
+@if not defined PYTHON_BUILD goto SvnPull\r
+\r
+@echo !!! WARNING !!! Setup environment to run Python scripts directly.\r
+\r
+@if not defined PYTHON_HOME (\r
+ @if defined PYTHONHOME (\r
+ @set PYTHON_HOME=%PYTHONHOME%\r
+ ) else (\r
+ @echo.\r
+ @echo !!! ERROR !!! PYTHON_HOME is required to build or execute the tools, please set it. !!!\r
+ @echo.\r
+ @goto ExitFailure\r
+ )\r
+)\r
+\r
+@set PATH=%PATH%;%BASE_TOOLS_PATH%\BinWrappers\WindowsLike\r
+@set BASETOOLS_PYTHON_SOURCE=%BASE_TOOLS_PATH%\Source\Python\r
+@set PYTHONPATH=%BASETOOLS_PYTHON_SOURCE%;%PYTHONPATH%\r