install.bat 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. @echo off
  2. if defined MSYSTEM (
  3. echo This .bat file is for Windows CMD.EXE shell only.
  4. goto end
  5. )
  6. :: Missing requirements check
  7. set MISSING_REQUIREMENTS=
  8. python.exe --version >NUL 2>NUL
  9. if %errorlevel% neq 0 set "MISSING_REQUIREMENTS= python &echo\"
  10. git.exe --version >NUL 2>NUL
  11. if %errorlevel% neq 0 set "MISSING_REQUIREMENTS=%MISSING_REQUIREMENTS% git"
  12. if not "%MISSING_REQUIREMENTS%" == "" goto :error_missing_requirements
  13. :: Infer IDF_PATH from script location
  14. set IDF_PATH=%~dp0
  15. set IDF_PATH=%IDF_PATH:~0,-1%
  16. set TARGETS="all"
  17. if NOT "%1"=="" set TARGETS=%*
  18. echo Installing ESP-IDF tools
  19. python.exe "%IDF_PATH%\tools\idf_tools.py" install --targets=%TARGETS%
  20. if %errorlevel% neq 0 goto :end
  21. echo Setting up Python environment
  22. python.exe "%IDF_PATH%\tools\idf_tools.py" install-python-env
  23. if %errorlevel% neq 0 goto :end
  24. echo All done! You can now run:
  25. echo export.bat
  26. goto :end
  27. :error_missing_requirements
  28. echo.
  29. echo Error^: The following tools are not installed in your environment.
  30. echo.
  31. echo %MISSING_REQUIREMENTS%
  32. echo.
  33. echo Please use the Windows Tool installer for setting up your environment.
  34. echo Download link: https://dl.espressif.com/dl/esp-idf/
  35. echo For more details please visit our website: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/windows-setup.html
  36. goto :end
  37. :end