build_installer.sh 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. #!/usr/bin/env 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. INSTALLER_TYPE="${1-full}"
  12. echo "Selected installer type: $INSTALLER_TYPE"
  13. echo "Available installer types: full, netinst"
  14. PACKAGES="all"
  15. if [[ "$INSTALLER_TYPE" == "netinst" ]]; then
  16. PACKAGES="idf-python"
  17. fi
  18. iscc_path=$(which iscc)
  19. if [[ -z "$iscc_path" ]]; then
  20. echo "Inno setup compiler (iscc) not found. Are you running wine-innosetup Docker image?"
  21. exit 1
  22. fi
  23. if [[ -z "${IDF_PATH:-}" ]]; then
  24. export IDF_PATH=$(cd ../../../; pwd)
  25. echo "Assuming IDF_PATH: ${IDF_PATH}"
  26. fi
  27. echo "Downloading IDF Tools..."
  28. mkdir -p idf_tools_tmp
  29. export IDF_TOOLS_PATH=$PWD/idf_tools_tmp
  30. $IDF_PATH/tools/idf_tools.py --non-interactive download --platform Windows-x86_64 $PACKAGES
  31. $IDF_PATH/tools/idf_tools.py --tools-json tools_fallback.json --non-interactive download --platform Windows-x86_64 all
  32. mkdir -p dist
  33. cp idf_tools_tmp/dist/* dist/
  34. echo "Downloading 7z..."
  35. mkdir -p unzip
  36. pushd unzip
  37. wget --no-verbose -O 7z1900-extra.7z https://www.7-zip.org/a/7z1900-extra.7z
  38. 7zr e -y 7z1900-extra.7z
  39. popd
  40. echo "Downloading idf_versions.txt..."
  41. wget --no-verbose -O idf_versions.txt https://dl.espressif.com/dl/esp-idf/idf_versions.txt
  42. echo "Running ISCC..."
  43. # https://jrsoftware.org/ishelp/index.php?topic=compilercmdline
  44. iscc idf_tool_setup.iss