install.bat 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. echo Installing ESP-IDF tools
  18. python.exe %IDF_PATH%\tools\idf_tools.py install
  19. if %errorlevel% neq 0 goto :end
  20. echo Setting up Python environment
  21. python.exe %IDF_PATH%\tools\idf_tools.py install-python-env
  22. if %errorlevel% neq 0 goto :end
  23. echo All done! You can now run:
  24. echo export.bat
  25. goto :end
  26. :error_missing_requirements
  27. echo.
  28. echo Error^: The following tools are not installed in your environment.
  29. echo.
  30. echo %MISSING_REQUIREMENTS%
  31. echo.
  32. echo Please use the Windows Tool installer for setting up your environment.
  33. echo Download link: https://dl.espressif.com/dl/esp-idf/
  34. echo For more details please visit our website: https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/windows-setup.html
  35. goto :end
  36. :end