A Python port of the Invisible Internet Project (I2P)
1#!/usr/bin/env bash
2# Build Windows .exe installer for i2p-python.
3# Uses pynsist to cross-compile from Linux — never runs on bare metal.
4#
5# pynsist resolves all paths relative to the .cfg file's directory.
6# We first build the wheel, then run pynsist from packaging/windows/.
7set -euo pipefail
8
9VERSION=$(python3 -c "
10import tomllib
11with open('pyproject.toml', 'rb') as f:
12 print(tomllib.load(f)['project']['version'])
13")
14echo "=== Building i2p-python ${VERSION} Windows installer ==="
15
16# Step 1: Build the wheel (needed as local_wheels dependency)
17pip install --quiet build 2>/dev/null
18python3 -m build --wheel --outdir dist/ 2>/dev/null
19
20# Step 2: Run pynsist from the cfg file's directory
21cd packaging/windows
22python3 -m nsist installer.cfg
23
24# Step 3: Move artifact to output
25cp build/nsis/*.exe "/out/" 2>/dev/null
26
27echo "=== Windows installer built ==="
28ls -lh /out/*.exe 2>/dev/null || echo "No .exe artifacts found"