#!/bin/sh # Build the Windows management app from Linux and lay it out ready to zip (admin.spec.md, "Windows build"): # Jarvis/jarvis.exe, Jarvis/WebView2Loader.dll, Jarvis/python-src/{voice_worker,jarvis}, # Jarvis/display-driver/ (Virtual Display Driver 25.7.23, MIT, SignPath-signed; "Virtual monitor"), # Jarvis/agent-desktop.exe (agent-desktop 1.2.0, Apache-2.0; "PC control") # Needs the x86_64-pc-windows-gnu Rust target, mingw-w64, cmake (for Opus), curl, unzip and tar. # app/shell/package.sh set -eu here=$(cd "$(dirname "$0")" && pwd) out=${1:?output folder} target=${CARGO_TARGET_DIR:-$here/target} cargo build --release --locked --target x86_64-pc-windows-gnu --manifest-path "$here/Cargo.toml" rel="$target/x86_64-pc-windows-gnu/release" rm -rf "$out/Jarvis" mkdir -p "$out/Jarvis/python-src" cp "$rel/jarvis.exe" "$rel/WebView2Loader.dll" "$out/Jarvis/" # The worker and brain sources only (the worker venv gets its packages from the requirement files). for pkg in voice_worker jarvis; do (cd "$here/../../src" && find "$pkg" -name __pycache__ -prune -o -name '*.spec.md' -prune -o -type f -print) | while read -r f; do mkdir -p "$out/Jarvis/python-src/$(dirname "$f")"; cp "$here/../../src/$f" "$out/Jarvis/python-src/$f"; done done # The virtual monitor's driver, pinned by hash; its sample settings file is not used (the app # writes its own). vdd_url=https://github.com/VirtualDrivers/Virtual-Display-Driver/releases/download/25.7.23/VirtualDisplayDriver-x86.Driver.Only.zip vdd_sha=e24210692b442b39af763536330ce78b423f19342b7a7792c26de3944e418b3a vdd_zip="$target/vdd-25.7.23.zip" [ -f "$vdd_zip" ] || curl -fsSL -o "$vdd_zip" "$vdd_url" echo "$vdd_sha $vdd_zip" | sha256sum -c - >/dev/null || { rm -f "$vdd_zip"; echo "display driver hash mismatch" >&2; exit 1; } tmp=$(mktemp -d "$target/vdd.XXXXXX") unzip -q "$vdd_zip" -d "$tmp" mkdir -p "$out/Jarvis/display-driver" cp "$tmp/VirtualDisplayDriver/MttVDD.inf" "$tmp/VirtualDisplayDriver/mttvdd.cat" "$tmp/VirtualDisplayDriver/MttVDD.dll" "$out/Jarvis/display-driver/" rm -rf "$tmp" # PC control's agent-desktop, the archive and the program pinned by hash as in app/src/pc.rs (the # app checks the program's hash again before every start of the services). ad_url=https://github.com/vercel-labs/agent-desktop/releases/download/v1.2.0/agent-desktop-v1.2.0-x86_64-pc-windows-msvc.tar.gz ad_sha=a4199f741a441cedd349bf56c5eba01783b1261258b498efeb7ec9945220c3e8 ad_exe_sha=d274667031322e50b9c2b1ab81c2ca46835d52cc932769a5c34bd4d481fd94c3 ad_tgz="$target/agent-desktop-1.2.0.tar.gz" [ -f "$ad_tgz" ] || curl -fsSL -o "$ad_tgz" "$ad_url" echo "$ad_sha $ad_tgz" | sha256sum -c - >/dev/null || { rm -f "$ad_tgz"; echo "agent-desktop hash mismatch" >&2; exit 1; } tar -xzf "$ad_tgz" -C "$out/Jarvis" agent-desktop.exe echo "$ad_exe_sha $out/Jarvis/agent-desktop.exe" | sha256sum -c - >/dev/null || { echo "agent-desktop.exe hash mismatch" >&2; exit 1; } echo "$out/Jarvis"