2020-04-02 19:10:02 -04:00
|
|
|
#!/usr/bin/env bash
|
2018-04-24 04:23:57 -04:00
|
|
|
#
|
2019-09-22 23:42:01 -04:00
|
|
|
# Script to build the IDF Tools installer for Windows with Inno Setup.
|
|
|
|
# This script should be executed inside wine-innosetup docker image.
|
2018-04-24 04:23:57 -04:00
|
|
|
#
|
2019-09-22 23:42:01 -04:00
|
|
|
# - Downloads all tools to install into the "dist/" directory
|
|
|
|
# - Downloads 7z and idf_versions.txt
|
2018-04-24 04:23:57 -04:00
|
|
|
# - Runs ISCC under wine to compile the installer itself
|
2019-09-22 23:42:01 -04:00
|
|
|
|
2018-04-24 04:23:57 -04:00
|
|
|
set -e
|
2019-09-22 23:42:01 -04:00
|
|
|
set -u
|
2018-04-24 04:23:57 -04:00
|
|
|
|
2021-01-19 07:34:32 -05:00
|
|
|
INSTALLER_TYPE="${1-full}"
|
2020-12-16 11:40:13 -05:00
|
|
|
|
|
|
|
echo "Selected installer type: $INSTALLER_TYPE"
|
|
|
|
echo "Available installer types: full, netinst"
|
|
|
|
|
|
|
|
PACKAGES="all"
|
|
|
|
if [[ "$INSTALLER_TYPE" == "netinst" ]]; then
|
|
|
|
PACKAGES="idf-python"
|
|
|
|
fi
|
|
|
|
|
2019-09-22 23:42:01 -04:00
|
|
|
iscc_path=$(which iscc)
|
|
|
|
if [[ -z "$iscc_path" ]]; then
|
|
|
|
echo "Inno setup compiler (iscc) not found. Are you running wine-innosetup Docker image?"
|
2018-10-01 02:22:07 -04:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2019-09-22 23:42:01 -04:00
|
|
|
if [[ -z "${IDF_PATH:-}" ]]; then
|
|
|
|
export IDF_PATH=$(cd ../../../; pwd)
|
|
|
|
echo "Assuming IDF_PATH: ${IDF_PATH}"
|
2018-10-01 02:22:07 -04:00
|
|
|
fi
|
2018-04-24 04:23:57 -04:00
|
|
|
|
2019-09-22 23:42:01 -04:00
|
|
|
echo "Downloading IDF Tools..."
|
|
|
|
mkdir -p idf_tools_tmp
|
|
|
|
export IDF_TOOLS_PATH=$PWD/idf_tools_tmp
|
2020-12-16 11:40:13 -05:00
|
|
|
$IDF_PATH/tools/idf_tools.py --non-interactive download --platform Windows-x86_64 $PACKAGES
|
2019-09-22 23:42:01 -04:00
|
|
|
$IDF_PATH/tools/idf_tools.py --tools-json tools_fallback.json --non-interactive download --platform Windows-x86_64 all
|
|
|
|
mkdir -p dist
|
|
|
|
cp idf_tools_tmp/dist/* dist/
|
|
|
|
|
|
|
|
echo "Downloading 7z..."
|
|
|
|
mkdir -p unzip
|
|
|
|
pushd unzip
|
|
|
|
wget --no-verbose -O 7z1900-extra.7z https://www.7-zip.org/a/7z1900-extra.7z
|
|
|
|
7zr e -y 7z1900-extra.7z
|
|
|
|
popd
|
|
|
|
|
|
|
|
echo "Downloading idf_versions.txt..."
|
|
|
|
wget --no-verbose -O idf_versions.txt https://dl.espressif.com/dl/esp-idf/idf_versions.txt
|
|
|
|
|
|
|
|
echo "Running ISCC..."
|
2020-12-16 11:40:13 -05:00
|
|
|
# https://jrsoftware.org/ishelp/index.php?topic=compilercmdline
|
2021-01-26 08:21:44 -05:00
|
|
|
iscc idf_tool_setup.iss
|