igneum/packaging/windows/make-wallet-payload.sh
igneum-labs cda3c5b388 Igneum Wallet: the Windows build chain (8 October 2026, main's order after 0.1.6: a Windows arm by the wallet's next OTA, PC 2 by job when it is back). The pieces, the miner's chain step for step with the wallet's names: packaging/windows/push-build-inputs.sh --wallet packs app/igneum-wallet and app/igneum-common into the build-inputs zip with vendor/igneum-node as a symlink to node/ (the wallet links the node's rpc crates by that path; unzip restores it inside the distro) and adds the build unit {app/igneum-wallet, igneum-wallet, windows} with its tests, so the PC's build job makes igneum-wallet.exe on the gnu target as it makes igneum-app.exe; packaging/windows/push-wallet-kit.sh publishes the kit zip (the host sources and BUILD-WALLET-APP.bat, build-installer.ps1, Igneum-Wallet.iss, stop-igneum-wallet.ps1, the icons, the wallet's packaged igneum-wallet.json from the token file) to the downloads host; relay/playbooks/wallet-kit-pc2.ps1 is the run job on PC 2: the host through BUILD-WALLET-APP.bat (MSVC, WebView2 SDK), the payload from the build job's engine and the node pin, the installer through build-installer.ps1 -Product wallet (Inno, rcedit), the smoke run with the host's version block, and, over a running older wallet, the installer end to end with the installed version read back (rule 14), every output dropped on the relay with its sha256; packaging/windows/build-installer.ps1 takes -Product miner|wallet (folder, engine, stop script, exes, .iss, setup name, the version-block stamping by product); packaging/windows/Igneum-Wallet.iss is rebuilt on release-0.3.25's detach-safe miner shape (install-close-23 and install-detach-25: the payload's own stop script with -Install, the install marker under igneum\wallet, the one-shot detached task under the app's job runner, the version-named file refusal, the stale-marker clear) with the wallet's names; packaging/windows/stop-igneum-wallet.ps1 is the miner's 0.3.23 stop script for the wallet (the host first by path, the engine through its API, the unlock wait with the STILL LOCKED line); make-wallet-payload.sh is the Mac-side payload maker for a hand build. release-0.3.25's installer-stop-check passes on the wallet pair (every rule holds); the check itself stays on the release line, whose miner installer carries the shape master's does not yet. Signing: as the miner's, deferred until the certificates exist (release-0.3.20 section 2.4). Untested on a PC until PC 2 returns: the first run is the known-failed run by design.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-08 11:59:16 +00:00

67 lines
4.8 KiB
Bash
Executable file

#!/usr/bin/env bash
# Assembles the Windows payload for Igneum Wallet (8 October 2026, the wallet's Windows arm: the miner's make-payload.sh
# step for step, with the wallet's pieces) and zips it: packaging/windows/igneum-windows-wallet/ and the zip at $1
# (default ~/Desktop/igneum-windows-wallet.zip). On the PC: extract the zip next to packaging\windows, run
# app\windows\BUILD-WALLET-APP.bat (the WebView2 window host), then packaging\windows\build-installer.ps1 -Product wallet.
#
# What goes in:
# igneum-wallet.exe the engine (app/igneum-wallet), built on the MSVC target on a PC or by a job
# (IGNEUM_WALLET_EXE names it; the default is the PC job's cargo output)
# igneumd.exe the node the wallet starts when the miner's is not on the machine (the same pin as the
# miner's payload: IGNEUM_WIN_RELEASE)
# lib*.dll the mingw runtime DLLs when the node exe needs them, as the miner's payload ships them
# igneum-wallet.json the update manifest URL, the public RPC, the add-network page, the consensus override
# (packaging/mac/packaged-config.sh write_wallet_config; the token stays out of the repo)
# stop-igneum-wallet.ps1 what the installer runs before an upgrade and on uninstall
# app\windows\ wallet-host.cpp, wallet-host.rc, wallet-version.h, biometric.h, BUILD-WALLET-APP.bat
# Igneum Wallet.exe the window host, when app/windows/dist/ holds one (BUILD-WALLET-APP.bat ran before this)
# Nothing of the miner's rides here: no GPU workers, no prover, no WSL2.
set -euo pipefail
HERE="$(cd "$(dirname "$0")" && pwd)"
ROOT="$(cd "$HERE/../.." && pwd)"
VERSION="$(sed -n 's/^version = "\(.*\)"/\1/p' "$ROOT/app/igneum-wallet/Cargo.toml" | head -1)"
OUT="${1:-$HOME/Desktop/igneum-windows-wallet.zip}"
case "$OUT" in /*) ;; *) OUT="$PWD/$OUT" ;; esac
mkdir -p "$(dirname "$OUT")"
REL="${IGNEUM_WIN_RELEASE:-$ROOT/vendor/igneum-node/target-integration/x86_64-pc-windows-gnu/release}"
ENGINE="${IGNEUM_WALLET_EXE:-$ROOT/app/igneum-wallet/target/x86_64-pc-windows-msvc/release/igneum-wallet.exe}"
MINGW=/opt/homebrew/opt/mingw-w64/toolchain-x86_64/x86_64-w64-mingw32
STAGE="$HERE/igneum-windows-wallet"
. "$ROOT/packaging/mac/packaged-config.sh"
[ -f "$ENGINE" ] || { echo "no $ENGINE: build the wallet engine for Windows first (cd app/igneum-wallet && cargo build --release, on a PC or by job; IGNEUM_WALLET_EXE names another)" >&2; exit 1; }
[ -f "$REL/igneumd.exe" ] || { echo "no $REL/igneumd.exe; the node's Windows build is missing (IGNEUM_WIN_RELEASE)" >&2; exit 1; }
rm -rf "$STAGE"
mkdir -p "$STAGE/app/windows/art"
cp "$ENGINE" "$STAGE/igneum-wallet.exe"
cp "$REL/igneumd.exe" "$STAGE/igneumd.exe"
for dll in lib/libstdc++-6.dll lib/libgcc_s_seh-1.dll bin/libwinpthread-1.dll; do
name="$(basename "$dll")"
if [ -f "$REL/$name" ]; then cp "$REL/$name" "$STAGE/"
elif [ -f "$MINGW/$dll" ]; then cp "$MINGW/$dll" "$STAGE/"; x86_64-w64-mingw32-strip "$STAGE/$name" 2>/dev/null || true
else echo "note: $name not found (the node exe is linked -static, so it may not need it)"; fi
done
[ -x "$HERE/check-runtime-dlls.sh" ] && "$HERE/check-runtime-dlls.sh" "$STAGE" || true
cp "$ROOT/app/windows/wallet-host.cpp" "$ROOT/app/windows/wallet-host.rc" "$ROOT/app/windows/wallet-version.h" "$ROOT/app/windows/biometric.h" "$ROOT/app/windows/BUILD-WALLET-APP.bat" "$STAGE/app/windows/"
cp "$ROOT/brand/icons/igneum.ico" "$STAGE/app/windows/art/"
if [ -f "$ROOT/app/windows/dist/Igneum Wallet.exe" ]; then cp "$ROOT/app/windows/dist/Igneum Wallet.exe" "$STAGE/"; echo "window host: Igneum Wallet.exe from app/windows/dist"; fi
cp "$HERE/stop-igneum-wallet.ps1" "$STAGE/stop-igneum-wallet.ps1"
write_wallet_config "$STAGE/igneum-wallet.json"
cat > "$STAGE/README.txt" <<TXT
Igneum Wallet $VERSION for Windows (payload). Test network; nothing is bought or sold.
Nobody from Igneum will ever ask for your words or your key.
This folder is what the installer packs. To build the installer on a PC:
1. app\\windows\\BUILD-WALLET-APP.bat builds "Igneum Wallet.exe" (the window; needs Visual Studio)
2. packaging\\windows\\build-installer.ps1 -Product wallet builds Igneum-Wallet-Setup-$VERSION.exe (Inno Setup via winget)
To run without the installer: double-click igneum-wallet.exe (the wallet opens in your browser).
TXT
for f in "$STAGE/README.txt" "$STAGE/stop-igneum-wallet.ps1" "$STAGE/app/windows/BUILD-WALLET-APP.bat"; do
[ -f "$f" ] && perl -pi -e 's/\r?\n/\r\n/' "$f"
done
rm -f "$OUT"
if command -v zip >/dev/null 2>&1; then (cd "$HERE" && zip -qr "$OUT" "igneum-windows-wallet" -x '*.DS_Store')
elif command -v 7z >/dev/null 2>&1; then (cd "$HERE" && 7z a -tzip -bso0 -bsp0 "$OUT" "igneum-windows-wallet" '-xr!.DS_Store')
else echo "neither zip nor 7z is on PATH" >&2; exit 1; fi
echo "staged $STAGE"
ls -la "$OUT"