Skip to content

v0.2.1: the update no longer stops at adb.exe - #9

Merged
Qwinty merged 2 commits into
mainfrom
fix/update-adb-lock
Sep 29, 2026
Merged

Qwinty merged 2 commits into
mainfrom
fix/update-adb-lock

Conversation

@Qwinty

@Qwinty Qwinty commented Sep 29, 2026

Copy link
Copy Markdown
Owner

Updating from the app stopped at Error opening file for writing for resources\adb.exe, AdbWinApi.dll and AdbWinUsbApi.dll.

Why: the adb server Plugcam starts keeps running after the app exits and holds those files open. The Tauri installer only checks Plugcam.exe, and Controller::shutdown stops the camera but not adb.

Fix (src-tauri/windows/hooks.nsh), before files are copied on install and before uninstall:

  1. adb kill-server from the install folder (5 s limit).
  2. If the server is still there, its three files are renamed to .old. A running exe or DLL can be renamed but not overwritten; the camera DLL is already handled this way. The .old files are deleted after install, or at reboot if they are still locked.

The new installer runs the hooks, so updating from 0.2.0 to 0.2.1 already gets the fix.

Also: version 0.2.1, release notes docs/releases/v0.2.1.md, site version.

Tested

Built and tested locally (Actions is locked):

  • cargo test --release: 87 passed, 2 ignored.
  • A small NSIS installer using these hooks, run over a live adb server started from its install folder (on a separate port):
    • without the hook, the file is locked;
    • with the hook, kill-server stops the server, the new files are written and no .old files are left;
    • when the server ignores kill-server, the install still succeeds and the old files are moved to .old.
  • Signed build: Plugcam_0.2.1_x64-setup.exe (7.25 MiB), portable zip, latest.json. The signatures use the key in plugins.updater.pubkey (FD67DFC875B6FFB0). The generated installer.nsi includes the hooks before CheckIfAppIsRunning and before files are copied.

Not tested: the full 0.2.1 installer over a real installation (it needs UAC).

Co-authored-by: Claude noreply@anthropic.com

The adb server Plugcam starts keeps running after the app exits and holds
adb.exe, AdbWinApi.dll and AdbWinUsbApi.dll open, so an update stopped at
"Error opening file for writing". The install and uninstall hooks now run
adb kill-server and, if the server stays, move its files aside like the
camera DLL.
- Version 0.2.1 in package.json, tauri.conf.json, Cargo.toml and Cargo.lock
- Release notes for the installer fix, with what to do if an update is stuck
- Site: version 0.2.1; the installer is still 7.2 MB
@Qwinty
Qwinty merged commit 67848f6 into main Sep 29, 2026
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant