feat: ship an Inno Setup installer from the windows release job
All checks were successful
CI / macos (push) Successful in 43s
CI / windows (push) Successful in 2m15s
CI / linux (push) Successful in 2m16s

This commit is contained in:
randogoth 2026-10-09 10:42:50 +03:00
parent 6bb850b9af
commit 433573693c
4 changed files with 90 additions and 10 deletions

42
windows/carrier.iss Normal file
View file

@ -0,0 +1,42 @@
; carrier Windows installer. Packs the same portable bundle windows/
; bundle.sh produces (dist/) into a classic setup.exe: Program Files,
; Start Menu shortcut, optional desktop icon, Apps & Features uninstall
; entry. Built by windows/installer.sh, which passes /DVersion= from
; Cargo.toml.
;
; Not yet wired into the forgejo release job - deliberately local until
; the experience is signed off.
#ifndef Version
#error Pass the version: ISCC /DVersion=0.2.0 windows/carrier.iss
#endif
[Setup]
AppId={{345BADA4-146B-4F57-B7D3-E9FD5D664F4B}
AppName=carrier
AppVersion={#Version}
AppPublisher=randogoth
DefaultDirName={autopf}\carrier
DefaultGroupName=carrier
; Next to the portable zip (paths relative to this script's directory).
OutputDir=..
OutputBaseFilename=carrier-windows-{#Version}-setup
Compression=lzma2/max
SolidCompression=yes
WizardStyle=modern
ArchitecturesInstallIn64BitMode=x64compatible
UninstallDisplayName=carrier
[Tasks]
Name: "desktopicon"; Description: "Create a &desktop icon"; GroupDescription: "Additional icons:"
[Files]
Source: "..\dist\*"; DestDir: "{app}"; Flags: recursesubdirs createallsubdirs ignoreversion
[Icons]
; Shortcut icons come from carrier.exe's embedded .ico resource.
Name: "{group}\carrier"; Filename: "{app}\carrier.exe"
Name: "{autodesktop}\carrier"; Filename: "{app}\carrier.exe"; Tasks: desktopicon
[Run]
Filename: "{app}\carrier.exe"; Description: "Launch carrier"; Flags: nowait postinstall skipifsilent

31
windows/installer.sh Normal file
View file

@ -0,0 +1,31 @@
#!/usr/bin/env bash
# Pack the dist/ bundle into carrier-windows-<version>-setup.exe.
#
# Run from the carrier checkout after windows/bundle.sh has produced
# dist/. Requires Inno Setup 7 (per-user install, which its own
# installer's "just me" option produces).
set -euo pipefail
say() { printf '\n==> %s\n' "$*"; }
die() { printf '\n!! %s\n' "$*" >&2; exit 1; }
# MSYS2's login shells prune LOCALAPPDATA from the environment, so fall
# back to cygpath (CSIDL 28 = local AppData of the current user).
if [ -n "${LOCALAPPDATA:-}" ]; then
appdata=$(cygpath -u "$LOCALAPPDATA")
else
appdata=$(cygpath -F 28)
fi
ISCC="$appdata/Programs/Inno Setup 7/ISCC.exe"
[ -f "$ISCC" ] || die "Inno Setup not found at $ISCC — install it from https://jrsoftware.org/isdl.php"
[ -d dist ] || die "no dist/ bundle — run windows/bundle.sh first"
version=$(sed -n 's/^version = "\(.*\)"$/\1/p' Cargo.toml | head -1)
say "compiling the installer"
# MSYS2_ARG_CONV_EXCL stops MSYS2 mangling /DVersion into a path.
MSYS2_ARG_CONV_EXCL="*" "$ISCC" /DVersion="$version" windows/carrier.iss \
|| die "ISCC failed"
say "done — carrier-windows-$version-setup.exe (in the checkout root)"