install.bat 1.4 KB

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