Files
samiandClaude Opus 5.5 9dd43b76e9
ci / build (ubuntu-22.04) (push) Canceled after 0s
ci / build (windows-2025) (push) Canceled after 0s
ci / deny (push) Canceled after 0s
Windows installer: fix the Windows build and register the browser host
- main.rs: the Windows clipboard branch dropped the copy's Result (only the non-Windows branch was
  checked), which failed to compile for Windows; both now report a failed copy.
- windows/hooks.nsh: the NSIS installer writes the native messaging manifests next to kestrove-nmh.exe
  and registers them under HKCU for Chrome, Chromium, Edge, Brave, Vivaldi and Firefox; uninstall
  removes them. Per-user install.
- scripts/windows.sh: cross-build with cargo-xwin, compile the installer with NSIS 3.11 in a Debian 13
  container (Homebrew's makensis 3.13 crashes on macOS).

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 19:32:06 +09:00

27 lines
1.7 KiB
Bash
Executable File

#!/bin/sh
# Windows installer (NSIS, x64) cross-built on macOS → ../release/desktop/Kestrove_<v>_x64-setup.exe
#
# Needs: brew install llvm lld nsis; cargo install --locked cargo-xwin; rustup target add x86_64-pc-windows-msvc;
# Docker. cargo-xwin downloads the Microsoft CRT and Windows SDK: setting XWIN_ACCEPT_LICENSE=1 accepts
# Microsoft's license for them (done only after the maintainer agreed to it).
#
# Homebrew's makensis 3.13 crashes on macOS (std::bad_alloc even for a trivial script), so Tauri's bundling
# step is expected to fail here; the generated installer.nsi is then compiled with NSIS 3.11 from Debian 13
# in a container, with the same absolute paths mounted.
set -eu
cd "$(dirname "$0")/.."
: "${XWIN_ACCEPT_LICENSE:?set XWIN_ACCEPT_LICENSE=1 to accept the Microsoft CRT/SDK license used by cargo-xwin}"
export XWIN_ACCEPT_LICENSE PATH="/opt/homebrew/opt/llvm/bin:/opt/homebrew/opt/lld/bin:$PATH"
V=$(node -p 'require("./package.json").version')
T="$PWD/src-tauri/target/x86_64-pc-windows-msvc/release"
OUT="$PWD/../release/desktop"
mkdir -p "$OUT"
npm run tauri build -- --runner cargo-xwin --target x86_64-pc-windows-msvc --bundles nsis || true
[ -f "$T/nsis/x64/installer.nsi" ] || { echo "no installer.nsi: the app build failed" >&2; exit 1; }
CACHE="$HOME/Library/Caches/tauri"
docker run --rm --platform linux/arm64 -v "$PWD:$PWD" -v "$CACHE:$CACHE:ro" -w "$T/nsis/x64" debian:13 \
sh -c 'apt-get update -qq >/dev/null && apt-get install -y -qq nsis >/dev/null && makensis -INPUTCHARSET UTF8 -V2 installer.nsi'
cp "$T/nsis/x64/nsis-output.exe" "$OUT/Kestrove_${V}_x64-setup.exe"
cp "$T/kestrove-nmh.exe" "$OUT/kestrove-nmh-windows-x86_64.exe"
ls -l "$OUT"/*.exe