#!/usr/bin/env bash # Build Windows .exe installer for i2p-python. # Uses pynsist to cross-compile from Linux — never runs on bare metal. # # pynsist resolves all paths relative to the .cfg file's directory. # We first build the wheel, then run pynsist from packaging/windows/. set -euo pipefail VERSION=$(python3 -c " import tomllib with open('pyproject.toml', 'rb') as f: print(tomllib.load(f)['project']['version']) ") echo "=== Building i2p-python ${VERSION} Windows installer ===" # Step 1: Build the wheel (needed as local_wheels dependency) pip install --quiet build 2>/dev/null python3 -m build --wheel --outdir dist/ 2>/dev/null # Step 2: Run pynsist from the cfg file's directory cd packaging/windows python3 -m nsist installer.cfg # Step 3: Move artifact to output cp build/nsis/*.exe "/out/" 2>/dev/null echo "=== Windows installer built ===" ls -lh /out/*.exe 2>/dev/null || echo "No .exe artifacts found"