app/src/pc.rs runs every pc_action from the worker (admin.spec.md, "PC control"): one agent-desktop 1.2.0 run per command with a 15 s limit and its state in the data folder, never --force or raw input, typed text only through stdin. Each action is decided by permissions::decide for its asker (not registered, never, ask without consent), then refused during the emergency stop, while an anti-cheat game runs (Vanguard, EAC, BattlEye, FACEIT, GameGuard, XIGNCODE3 and the person's list), on an administrator window and in a password field. Results carry the window and its elements read again (200 at most, cut to 120 chars), agent-desktop's error codes become Korean reasons, and each action is recorded as pc.<action> with the program's file name only. The emergency stop is a global hotkey (pcControl.stopHotkey, default Ctrl+Shift+F12) on its own message loop; it kills the running command and blocks everything but reading until pressed again or lifted on the PC control screen. features.pcControl (on by default, nothing happens until someone is registered) and the pinned exe hash decide whether the brain gets the tool. The installer ships agent-desktop.exe from the pinned release archive, both hashes checked. Tested with a fake agent-desktop (342 lib tests pass) and cargo check for x86_64-pc-windows-gnu; not yet run against real agent-desktop. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
29 lines
2.1 KiB
Bash
Executable File
29 lines
2.1 KiB
Bash
Executable File
#!/bin/sh
|
|
# The Jarvis installer (admin.spec.md, "Installer"): package.sh's Jarvis/ folder into one NSIS setup.
|
|
# app/shell/installer.sh <output folder> -> <output folder>/Jarvis-Setup-<version>.exe (+ .sha256)
|
|
# Needs makensis 3 (NSISDIR set when it is not installed system-wide) and curl.
|
|
set -eu
|
|
here=$(cd "$(dirname "$0")" && pwd)
|
|
out=$(mkdir -p "${1:?output folder}" && cd "$1" && pwd)
|
|
version=$(sed -n 's/^version = "\(.*\)"/\1/p' "$here/Cargo.toml" | head -1)
|
|
target=${CARGO_TARGET_DIR:-$here/target}
|
|
sh "$here/package.sh" "$out" >/dev/null
|
|
# The WebView2 runtime's bootstrapper (Microsoft, about 2 MB), run only on a PC without the runtime.
|
|
wv2="$target/MicrosoftEdgeWebview2Setup.exe"
|
|
[ -s "$wv2" ] || curl -fsSL -o "$wv2" "https://go.microsoft.com/fwlink/p/?LinkId=2124703"
|
|
# What the uninstaller removes: exactly the files installed under python-src and display-driver,
|
|
# then their folders, deepest first, each only when empty.
|
|
list="$target/uninstall-list.nsh"
|
|
(cd "$out/Jarvis" && find python-src display-driver -type f | sort | sed 's|/|\\|g; s|^| Delete "$INSTDIR\\|; s|$|"|'
|
|
cd "$out/Jarvis" && find python-src display-driver -type d | sort -r | sed 's|/|\\|g; s|^| RMDir "$INSTDIR\\|; s|$|"|') > "$list"
|
|
setup="$out/Jarvis-Setup-$version.exe"
|
|
# The uninstall entry's size: what this setup installs, counted here. Counting the install folder on
|
|
# the user's PC would also walk a data folder kept inside it (models, runtime: many thousand files).
|
|
size_kb=$(cd "$out/Jarvis" && du -sk --apparent-size -c jarvis.exe WebView2Loader.dll agent-desktop.exe python-src display-driver | tail -1 | cut -f1)
|
|
# The shortcuts' icon file is named by its content, so a new icon gets a path Windows has not seen.
|
|
icon_file="jarvis-$(sha256sum "$here/icons/icon.ico" | cut -c1-12).ico"
|
|
makensis -V2 -DVERSION="$version" -DSRC="$out/Jarvis" -DOUT="$setup" -DICON="$here/icons/icon.ico" -DICON_FILE="$icon_file" \
|
|
-DWEBVIEW2="$wv2" -DUNINSTALL_LIST="$list" -DSIZE_KB="$size_kb" ${NSIS_EXTRA:-} "$here/installer.nsi"
|
|
(cd "$out" && sha256sum "Jarvis-Setup-$version.exe" > "Jarvis-Setup-$version.exe.sha256")
|
|
echo "$setup"
|