67 lines
4.8 KiB
Bash
Executable file
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"
|