Ivan Grokhotkov e94288da31 global: use '/usr/bin/env bash' instead of '/usr/bin/bash' in shebangs il y a 5 ans
..
cmdlinerunner afbaf74007 tools: Mass fixing of empty prototypes (for -Wstrict-prototypes) il y a 6 ans
.gitignore 04d24c750a tools: new installer for Windows il y a 6 ans
README.md c780abc6a6 tools: update Windows installer build script il y a 6 ans
build_installer.sh e94288da31 global: use '/usr/bin/env bash' instead of '/usr/bin/bash' in shebangs il y a 5 ans
choice_page.iss.inc 04d24c750a tools: new installer for Windows il y a 6 ans
cmdline_page.iss.inc 04d24c750a tools: new installer for Windows il y a 6 ans
git_find_installed.iss.inc 04d24c750a tools: new installer for Windows il y a 6 ans
git_page.iss.inc 04d24c750a tools: new installer for Windows il y a 6 ans
idf_cmd_init.bat aaf3dcbda0 tools: installer: fix quoting of IDF_TOOLS_PATH il y a 6 ans
idf_download_page.iss.inc 9c5284e7b5 tools: installer: verify that IDF_PATH doesn't contain spaces il y a 6 ans
idf_page.iss.inc 9c5284e7b5 tools: installer: verify that IDF_PATH doesn't contain spaces il y a 6 ans
idf_setup.iss.inc 24e793baa3 tools: installer: add PYTHONUNBUFFERED=1 when calling idf_tools.py il y a 6 ans
idf_tool_setup.iss 69e91959ff tools: bump version of windows tools installer to v2.3 il y a 6 ans
license.txt efd62a50b9 windows: Add License (GPL) display to IDF Tools installer il y a 7 ans
main.iss.inc 880197307a Windows setup: fix Defender detection and add desktop shortcut option il y a 6 ans
python_find_installed.iss.inc 04d24c750a tools: new installer for Windows il y a 6 ans
python_page.iss.inc 04d24c750a tools: new installer for Windows il y a 6 ans
sign_installer.sh e94288da31 global: use '/usr/bin/env bash' instead of '/usr/bin/bash' in shebangs il y a 5 ans
summary.iss.inc 04d24c750a tools: new installer for Windows il y a 6 ans
tools_WD_clean.ps1 66aac70286 tools: WD exclusions support - internal improvements il y a 6 ans
tools_WD_excl.ps1 66aac70286 tools: WD exclusions support - internal improvements il y a 6 ans
tools_fallback.json e6e1792946 tools: update idf_exe to 1.0.1 il y a 6 ans
utils.iss.inc b67a7f48a9 tools: installer: fix copying IDF to a destination on another drive il y a 6 ans

README.md

ESP-IDF Tools Installer for Windows

This directory contains source files required to build the tools installer for Windows.

The installer is built using Inno Setup. At the time of writing, the installer can be built with Inno Setup version 6.0.2.

The main source file of the installer is idf_tools_setup.iss. PascalScript code is split into multiple *.iss.inc files.

Some functionality of the installer depends on additional programs:

  • Inno Download Plugin — used to download additional files during the installation.

  • 7-zip — used to extract downloaded IDF archives.

  • cmdlinerunner — a helper DLL used to run external command line programs from the installer, capture live console output, and get the exit code.

Building the installer

In Docker

This uses wine-innosetup Docker image and build_installer.sh script. This is how the installer is built in CI.

docker run --rm -v $IDF_PATH:/idf -w /idf/tools/windows/tool_setup -it $CI_DOCKER_REGISTRY/wine-innosetup:1 /bin/bash build_installer.sh

Manually, step by step

  • Build cmdlinerunner DLL.

    • On Linux/Mac, install mingw-w64 toolchain (i686-w64-mingw32-gcc). Then build the DLL using CMake:

      mkdir -p cmdlinerunner/build
      cd cmdlinerunner/build
      cmake -DCMAKE_TOOLCHAIN_FILE=../toolchain-i686-w64-mingw32.cmake -DCMAKE_BUILD_TYPE=Release ..
      cmake --build .
      

      This will produce cmdlinerunner.dll in the build directory.

    • On Windows, it is possible to build using Visual Studio, with CMake support installed. By default, VS produces build artifacts in some hard to find directory. You can adjust this in CmakeSettings.json file generated by VS.

  • Download 7zip.exe ("standalone console version") and put it into unzip directory (to get unzip/7za.exe).

  • Download idf_versions.txt and place it into the current directory. The installer will use it as a fallback, if it can not download idf_versions.txt at run time.

  • Create the dist directory and populate it with the tools which should be bundled with the installer. At the moment the easiest way to obtain it is to use install.sh/install.bat in IDF, and then copy the contents of $HOME/.espressif/dist directory. If the directory is empty, the installer should still work, and the tools will be downloaded during the installation.

  • Build the installer using Inno Setup Compiler: ISCC.exe idf_tools_setup.iss.

Signing the installer

  • Obtain the signing key (e.g key.pem) and the certificate chain (e.g. certchain.pem). Set the environment variables to point to these files:

    • export KEYFILE=key.pem
    • export CERTCHAIN=certchain.pem
  • Run sign_installer.sh script. This will ask for the key.pem password, and produce the signed installer in the Output directory. If you plan to run the script multiple times, you may also set KEYPASSWORD environment variable to the key.pem password, to avoid the prompt.