build_installer.sh 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/bin/bash
  2. #
  3. # Script to build the IDF Tools installer for Windows with Inno Setup.
  4. # This script should be executed inside wine-innosetup docker image.
  5. #
  6. # - Downloads all tools to install into the "dist/" directory
  7. # - Downloads 7z and idf_versions.txt
  8. # - Runs ISCC under wine to compile the installer itself
  9. set -e
  10. set -u
  11. iscc_path=$(which iscc)
  12. if [[ -z "$iscc_path" ]]; then
  13. echo "Inno setup compiler (iscc) not found. Are you running wine-innosetup Docker image?"
  14. exit 1
  15. fi
  16. if [[ -z "${IDF_PATH:-}" ]]; then
  17. export IDF_PATH=$(cd ../../../; pwd)
  18. echo "Assuming IDF_PATH: ${IDF_PATH}"
  19. fi
  20. echo "Downloading IDF Tools..."
  21. mkdir -p idf_tools_tmp
  22. export IDF_TOOLS_PATH=$PWD/idf_tools_tmp
  23. $IDF_PATH/tools/idf_tools.py --non-interactive download --platform Windows-x86_64 all
  24. $IDF_PATH/tools/idf_tools.py --tools-json tools_fallback.json --non-interactive download --platform Windows-x86_64 all
  25. mkdir -p dist
  26. cp idf_tools_tmp/dist/* dist/
  27. echo "Downloading 7z..."
  28. mkdir -p unzip
  29. pushd unzip
  30. wget --no-verbose -O 7z1900-extra.7z https://www.7-zip.org/a/7z1900-extra.7z
  31. 7zr e -y 7z1900-extra.7z
  32. popd
  33. echo "Downloading idf_versions.txt..."
  34. wget --no-verbose -O idf_versions.txt https://dl.espressif.com/dl/esp-idf/idf_versions.txt
  35. echo "Running ISCC..."
  36. iscc idf_tool_setup.iss