feat(app): the bot browser's window on a virtual monitor to share in Discord
- features.browserShare (봇용 크롬창 화면공유 선택 표시, off by default) and a driver card on the features screen: the Virtual Display Driver 25.7.23 (MIT, SignPath-signed) ships in display-driver/ (hash-checked by package.sh); install and uninstall run jarvis.exe elevated once (--display-driver), settings in %ProgramData%\JarvisBot\display-driver, another program's copy of the driver is left alone - the monitor is on the desktop only while the bot browser uses it, at the rightmost real monitor's bottom-right corner; the stop closes Chrome first, then takes the monitor off - Chrome starts with no window and the app opens it over CDP in the background, so it never takes the focus; the window is a tool window (no Alt+Tab, no taskbar button), fills the monitor's work area and keeps drawing when covered; without a monitor it runs headless with the reason on the dashboard - Chrome runs with --do-not-de-elevate on Windows: started by an app running as administrator it restarted itself as the user and the app lost hold of it - checked on the win-ci Windows VM from install to uninstall (focus kept while typing, no taskbar button, no Chrome left, nothing left after uninstall) and on Linux with a real Chrome Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
#!/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}
|
||||
# Needs the x86_64-pc-windows-gnu Rust target, mingw-w64 and cmake (for Opus).
|
||||
# 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")
|
||||
# Needs the x86_64-pc-windows-gnu Rust target, mingw-w64, cmake (for Opus), curl and unzip.
|
||||
# app/shell/package.sh <output folder>
|
||||
set -eu
|
||||
here=$(cd "$(dirname "$0")" && pwd)
|
||||
@@ -17,4 +18,16 @@ 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"
|
||||
echo "$out/Jarvis"
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
//! if that cannot be confirmed the window stays open and says so, and closing it again quits.
|
||||
//!
|
||||
//! jarvis [--location FILE]
|
||||
//! jarvis --display-driver install|uninstall --result FILE (elevated, started by the app)
|
||||
|
||||
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
|
||||
|
||||
@@ -36,6 +37,10 @@ fn arg(name: &str) -> Option<String> {
|
||||
}
|
||||
|
||||
fn main() {
|
||||
// The elevated half of installing or removing the virtual monitor's driver: no window.
|
||||
if let Some(code) = jarvis_app::vdisplay::elevated_main(&std::env::args().collect::<Vec<_>>()) {
|
||||
std::process::exit(code);
|
||||
}
|
||||
let location = arg("--location").map(PathBuf::from).or_else(jarvis_app::datadir::default_location_file)
|
||||
.expect("no location file path: pass --location");
|
||||
// Log files go to the data folder once there is one; until then memory only.
|
||||
|
||||
Reference in New Issue
Block a user