+@if not defined WORKSPACE (\r
+ @set "WORKSPACE=%CD%"\r
+)\r
+@if not exist "%BASE_TOOLS_PATH%" (\r
+ @if exist "%WORKSPACE%\BaseTools" (\r
+ set "BASE_TOOLS_PATH=%WORKSPACE%\BaseTools"\r
+ ) else (\r
+ @if defined PACKAGES_PATH (\r
+ @for %%i IN (%PACKAGES_PATH%) DO (\r
+ @if exist %%~fi\BaseTools (\r
+ @set BASE_TOOLS_PATH=%%~fi\BaseTools\r
+ @goto checkBaseTools\r
+ )\r
+ )\r
+ )\r
+ )\r
+)\r
+:checkBaseTools\r
+@if not defined BASE_TOOLS_PATH (\r
+ @echo.\r
+ @echo !!! ERROR !!! The BaseTools Package was not found !!!\r
+ @echo.\r
+ @goto ExitFailure\r
+)\r