Tool for building NSIS installers and managing Python dependency upgrades.
- Cross-Platform: Build Windows installers on Linux (using
makensisandpipcross-compilation). - Dependency Management: Automatically resolve dependencies from
pyproject.toml(usinguv) orrequirements.txt. - Upgrade Packages: Generate small upgrade installers containing only changed components by calculating diffs between version snapshots.
- Clean Builds: Ensure fresh downloads by cleaning package directories before building.
- Go 1.18+
- NSIS 3.0+ (
sudo apt install nsison Linux) - Python 3 (for
pip download) - uv (Required for resolving
pyproject.tomlcross-platform)
cd builder
go build -o builder main.go
# Recommended: move binary to root or add to PATH
mv builder ../phis-builder
cd ..Or use the convenience script (if you have fish shell):
./builder.fishDownload static resources like python-embed and VC_redist.
./phis-builder download-resourcesBuild the full installer with all dependencies.
./phis-builder build-installer --cleanBy default, --clean is true, which removes existing build/packages/ and build/pip_wheels/ before downloading.
Resolve current pyproject.toml (or requirements.txt) and save as a version snapshot (e.g., versions/requirements_20.txt).
./phis-builder snapshot-version --version 20Build an installer that upgrades from an older version (e.g., 1.9) to the current version (20).
./phis-builder build-upgrade --from-ver 1.9 --to-ver 20This will:
- Compare
versions/requirements_1.9.txtvsversions/requirements_20.txt(or resolve currentpyproject.tomlif snapshot is missing). - Download missing/upgraded wheels to
build/packages_upgrade_.... - Generate an NSIS script.
- Compile the upgrade installer (e.g.,
自动化平台_升级包_1.9_至_20.exe).
Configuration is loaded from resources/config.toml.