2019-04-28 22:37:02 -04:00
|
|
|
@echo off
|
|
|
|
if defined MSYSTEM (
|
2021-11-09 07:10:56 -05:00
|
|
|
echo This .bat file is for Windows CMD.EXE shell only.
|
2019-04-28 22:37:02 -04:00
|
|
|
goto end
|
|
|
|
)
|
2021-03-09 06:53:11 -05:00
|
|
|
|
|
|
|
:: Missing requirements check
|
|
|
|
set MISSING_REQUIREMENTS=
|
|
|
|
python.exe --version >NUL 2>NUL
|
|
|
|
if %errorlevel% neq 0 set "MISSING_REQUIREMENTS= python &echo\"
|
|
|
|
git.exe --version >NUL 2>NUL
|
|
|
|
if %errorlevel% neq 0 set "MISSING_REQUIREMENTS=%MISSING_REQUIREMENTS% git"
|
|
|
|
|
|
|
|
if not "%MISSING_REQUIREMENTS%" == "" goto :error_missing_requirements
|
|
|
|
|
2019-04-28 22:37:02 -04:00
|
|
|
:: Infer IDF_PATH from script location
|
|
|
|
set IDF_PATH=%~dp0
|
|
|
|
set IDF_PATH=%IDF_PATH:~0,-1%
|
|
|
|
|
2021-09-16 10:48:03 -04:00
|
|
|
for /f "delims=" %%i in ('python.exe "%IDF_PATH%\tools\install_util.py" extract targets "%*"') do set TARGETS=%%i
|
2021-04-26 15:34:48 -04:00
|
|
|
|
2019-04-28 22:37:02 -04:00
|
|
|
echo Installing ESP-IDF tools
|
2021-10-06 05:06:22 -04:00
|
|
|
python.exe "%IDF_PATH%\tools\idf_tools.py" install --targets=%TARGETS%
|
2019-07-23 00:20:52 -04:00
|
|
|
if %errorlevel% neq 0 goto :end
|
2019-04-28 22:37:02 -04:00
|
|
|
|
2021-09-16 10:48:03 -04:00
|
|
|
for /f "delims=" %%i in ('python.exe "%IDF_PATH%\tools\install_util.py" extract features "%*"') do set FEATURES=%%i
|
|
|
|
|
2019-04-28 22:37:02 -04:00
|
|
|
echo Setting up Python environment
|
2021-09-16 10:48:03 -04:00
|
|
|
python.exe "%IDF_PATH%\tools\idf_tools.py" install-python-env --features=%FEATURES%
|
2019-07-23 00:20:52 -04:00
|
|
|
if %errorlevel% neq 0 goto :end
|
2019-04-28 22:37:02 -04:00
|
|
|
|
|
|
|
echo All done! You can now run:
|
|
|
|
echo export.bat
|
2021-03-09 06:53:11 -05:00
|
|
|
goto :end
|
|
|
|
|
|
|
|
:error_missing_requirements
|
|
|
|
echo.
|
|
|
|
echo Error^: The following tools are not installed in your environment.
|
|
|
|
echo.
|
|
|
|
echo %MISSING_REQUIREMENTS%
|
|
|
|
echo.
|
|
|
|
echo Please use the Windows Tool installer for setting up your environment.
|
|
|
|
echo Download link: https://dl.espressif.com/dl/esp-idf/
|
|
|
|
echo For more details please visit our website: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/windows-setup.html
|
|
|
|
goto :end
|
2019-07-23 00:20:52 -04:00
|
|
|
|
|
|
|
:end
|