fix(app): the virtual monitor's driver never changes under running services and its failures can be retried

- installing or removing the driver is refused unless the services are stopped (or failed), and
  a service start or restart (and a second driver task) is refused while one runs, so the
  monitor never vanishes under the bot browser's window
- a failed or declined install undoes what that attempt made (device, and the registry value and
  settings folder when the driver was not ours before); a declined install's
  0xE0000243 reads as cancelled; installed means ours with its monitor there
- devices are found among all root devices whatever their class: a device whose driver was
  declined drops out of the display class and was left behind
- uninstall keeps the registry value (what makes it ours) until the device and the driver
  package are gone (a package not in the store, 1168, counts as gone), so a failed removal can
  be retried
- checked on the win-ci VM: a declined install leaves nothing, the next install gives one working
  device, the uninstall leaves nothing

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
javis-bot
2026-11-14 02:55:01 +09:00
parent 1bd7defbb4
commit cfab18a47e
4 changed files with 201 additions and 52 deletions

View File

@@ -289,10 +289,22 @@ the browser runs headless with a note.
points the driver at it (`HKLM\SOFTWARE\MikeTheTech\VirtualDisplayDriver` `VDDPATH`), creates the
device (`Root\MttVDD`, display class) and installs the driver; Windows then asks once whether to
install software from the SignPath Foundation. The new monitor is taken off the desktop at once.
A failed install, also the person answering no to that question ("취소했습니다"), undoes what
that attempt made (the device it created, and the registry value and settings folder when the
driver was not ours before), so nothing looks installed and the next attempt starts clean. The
status counts as installed only when the driver is ours and its monitor is there, so a device left
without its driver can be installed again. Devices are found by the hardware ID among all root
devices, whatever their class (a device whose driver was declined has none).
The settings: one monitor, one mode (1280x720 at 30 Hz), no custom EDID. When another program's
copy of the same driver is installed (its `VDDPATH` is not ours) the app refuses to install or
remove and never touches its monitors. Uninstall removes the device, the driver package, the
registry key and the settings folder.
remove and never touches its monitors. Uninstall removes the device, then the driver package (one
not in the driver store counts as gone), and only then the registry key, which makes it ours, and
the settings folder; when a device or the package stays, it fails with the reason and keeps the
registry key, so a retry is still allowed.
- **Never under running services**: installing or removing is refused unless the services are
stopped (or failed, which has stopped the bot browser already), so the monitor never vanishes
under the bot browser's window; while one runs, a service start or restart is refused, and a
second driver task too.
- **On only while used**: a service start first takes the monitor off the desktop (left over from a
run that ended badly). With `browserShare` it then attaches the monitor (no administrator needed)
right of and below the rightmost real monitor, touching it only at that monitor's bottom-right
@@ -387,7 +399,7 @@ back as Korean messages for the screen. The Tauri shell passes the screens' `inv
| `discord_channel_info` `{id}` / `channel_sync_status` | a channel's Discord name and topic / each synced chat channel's last result (above) |
| `collect_results` `{target, limit}` | `{targets, items}`: every target folder with results, and the collected items newest first (`target` null: every target; `limit` 1-500, default 100) |
| `mcp_env_status` / `mcp_env_set` `{server, name, value}` | which MCP environment values are stored (`{server: {NAME: bool}}`, never the values) / store one (an empty value removes it); only for a saved server and name |
| `display_driver_status` / `display_driver_install` / `display_driver_uninstall` | the virtual monitor's driver: `{supported, installed, other}` (Windows only; `other`: another program's copy) / install or remove it elevated (above), then its status |
| `display_driver_status` / `display_driver_install` / `display_driver_uninstall` | the virtual monitor's driver: `{supported, installed, other}` (Windows only; `other`: another program's copy) / install or remove it elevated (above), then its status; refused unless the services are stopped or failed, and `service_start` / `service_restart` are refused meanwhile |
| `install_status` / `install_start` / `install_cancel` | the install steps and their state, bytes and last line / run what is not done in the background / stop it |
| `logs_query` `{tab, level, find, after, limit}` / `logs_error_report` / `logs_export` `{from, to}` | the log hub; the zip goes to `logs/` and its path comes back |
@@ -497,9 +509,12 @@ log screen, error copy, zip export, and closing the window ending the process wi
to `%APPDATA%` or `%LOCALAPPDATA%`. The virtual monitor (`tests/vdisplay_elevated.rs`, no harness:
started elevated, the same program is the elevated half; `tests/bot_browser.rs` with a screen): the
driver installed through the elevated start (Windows' SignPath question answered once) with the
settings folder's permissions, the monitor off after install, on at the rightmost monitor's corner
settings folder's permissions, a declined install leaving no device, package, registry key or
settings folder and the next install giving one working device, the monitor off after install, on at the rightmost monitor's corner
while the bot browser runs and off after, one Chrome window there filling the work area and holding
the bot's tab, the focus staying in the program the user types into, no taskbar button, no Chrome
left after the stop, and the uninstall leaving no device, driver package, registry key or settings
folder. On Linux the same window test runs on an X display (one window at the given place and
folder. On every system: a removal forgets the driver only when no device is left and the package
is gone or was not in the store; driver tasks refused while the services start, and a start (and a
second task) refused while one runs, also after it failed. On Linux the same window test runs on an X display (one window at the given place and
size, the bot's tab in it).