Windows MSI: re-install/upgrade over an existing install fails with Error 1722 — install-driver.ps1 restarts the device before stopping the broker, poisoning the instance with pending-reboot
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 68/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- powershell
- Lĩnh vực
- tooling
Hướng nghiên cứu
Read install-driver.ps1, focusing on the existing-device path and the order of Stop-LibVirtualHidBrokerService, Update-RootDeviceDriverWithSetupApi, and Restart-RootDevice. Check how the driver custom action handles restart failures and reboot-required results. Verify that reinstalling over an existing install no longer fails with Error 1722 and that a deferred driver reload is reported appropriately.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Describe the Bug
On any machine where a previous install ran at least as far as the driver custom action (including a fully successful install), every subsequent run of libvirtualhid-Windows-AMD64-driver-installer.msi fails near the end with:
Error 1722. There is a problem with this Windows Installer package. A program run as
part of the setup did not finish as expected. Contact your support personnel or
package vendor. Action CA_LibVirtualHidInstallDriver
The MSI rolls back, but the staged driver package, the ROOT\LIBVIRTUALHID\0000 device instance and the libvirtualhid_broker service are not MSI-managed and survive the rollback — so the product never appears in Apps & Features while the driver "seems installed", and every retry fails the same way. Reproduced with installer 2026.1028.334.38 and 2026.1030.2010.1.
Root cause (two-stage, in install-driver.ps1, existing-device path)
The script sequence is:
Update-RootDeviceDriverWithSetupApi—libvirtualhid_driver_setup.exe update ...Restart-RootDevice—pnputil.exe /restart-device ROOT\LIBVIRTUALHID\0000, which throws on any non-zero exitInstall-LibVirtualHidBrokerService— this is where the broker gets stopped and reconfigured
Stage 1: the broker is registered start= auto and runs from boot; together with connected clients (e.g. Sunshine) it holds an open handle on the device, so the driver update's device restart is vetoed:
dvi: Query-removal during install of 'ROOT\LIBVIRTUALHID\0000' was vetoed by
'ROOT\LIBVIRTUALHID\0000' (veto type 5: PNP_VetoOutstandingOpen).
dvi: Device required reboot: Query remove failed (install) 0x17: CR_REMOVE_VETOED.
ndv: Reboot needed to complete driver update.
Stage 2: that veto leaves the device instance in "pending system reboot", after which every pnputil /restart-device is refused outright, regardless of what holds the handle:
Failed to restart device: ROOT\LIBVIRTUALHID\0000
Device is pending system reboot to complete a previous operation.
This command is not supported on the OS product.
→ exit code 50
The script turns that into a terminating error → powershell.exe -File exits 1 → MSI Error 1722 → rollback. This is a deadlock: the script can only stop the broker in step 3, after the restart in step 2 that the running broker blocks — and because a plain reboot does not help as long as the broker is running when the CA executes, the installer can never complete over an existing install. Both the interactive (CA_LibVirtualHidInstallDriver) and silent (...Silent) variants carry the identical command line.
The exit code 50 failure appears verbatim in the Microsoft-Windows-PowerShell/Operational event log (event 4100) for every failing run:
Error Message = pnputil.exe /restart-device ROOT\LIBVIRTUALHID\0000 exited with code 50
Steps to Reproduce
- Install the MSI once successfully (or run
install-driver.ps1elevated once) so the device instance and broker service exist. - Leave
libvirtualhid_brokerrunning (Automatic) — optionally with a client app using the device. - Run the same or a newer installer MSI elevated.
- File copy and driver staging succeed, then the install fails with Error 1722 at the driver CA; the product is absent from Apps & Features while device, service and staged driver remain.
- Every retry fails identically.
Expected Behavior
The installer should succeed over an existing install: stop the broker before touching or restarting the device, and report a deferred driver reload as a reboot-required condition instead of failing the whole transaction.
Suggested fix
- Call
Stop-LibVirtualHidBrokerServicebeforeUpdate-RootDeviceDriverWithSetupApi/Restart-RootDeviceon the existing-device path (the function already exists), and only start the broker again as the final step. - Treat a
pnputil /restart-devicefailure caused by pending-reboot/veto as a warning ("a reboot will complete the driver reload") rather than a terminating throw — or skip the restart when the instance is already in pending-reboot. - Consider signalling reboot-required to MSI instead of exiting non-zero.
Workaround (for users hitting this now)
Elevated:
net stop libvirtualhid_broker
pnputil /remove-device ROOT\LIBVIRTUALHID\0000
msiexec /i libvirtualhid-Windows-AMD64-driver-installer.msi /qn /l*v install.log
(Stop any client app using the device first. /remove-device clears the poisoned instance and the installer recreates it fresh; alternatively a reboot clears the pending-reboot flag — but the broker must not be running when the CA executes.) This took an install from a deterministic Error 1722 to msiexec exit 0 with the product correctly registered.
Additional Context
- Environment: Windows 11 Pro build 26300, Windows PowerShell 5.1.26100.9818, installer 2026.1030.2010.1 (identical failure on 2026.1028.334.38).
- Not a duplicate of #130 (Add-Type load failure, fixed in #131): this failure is at the
restart-devicestep and concerns ordering over an existing install. - Diagnosis was harder than necessary: in every failing run
Start-Transcriptfailed (Error Message = Transcription cannot be started, event 4100), so-LogPathnever captured the terminating error. The only trail was the PowerShell operational log plussetupapi.dev.log. Worth checking why the transcript cannot start on this path under Windows 11 / PS 5.1. - MSI rollback cannot unstage driver packages, so repeated failed runs accumulate one
oem*.infper attempt in the driver store (five had piled up here); a cleanup note or an uninstall-driver pass for orphans would help.
- Ngôn ngữ chính
- C++
- Star
- 99
- Fork
- 28
- Merge trung bình
- 1 ngày 13 giờ
- Pull request đã merge (30 ngày)
- 27
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của LizardByte/libvirtualhid
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
LizardByte/libvirtualhid#206 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Impulse trigger vibration not functioning on Moonlight 6.2.0Có thể đã có người làm @ReenigneArcher đã nhận 21 ngày trước. Đang mở
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 18/100
LizardByte/libvirtualhid#193 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Windows: Xbox Series Share button is unavailable through Steam's VHF/XInput pathCó thể làm lại được @LizardByte-bot đã nhận 71 ngày trước và không có pull request nào đang mở. Đang mở
LizardByte/libvirtualhid#106 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Linux: Chromium misremaps Xbox Series axes and triggers for virtual 045e:0b13 deviceCó thể làm lại được @LizardByte-bot đã nhận 82 ngày trước và không có pull request nào đang mở. Đang mở
LizardByte/libvirtualhid#84 · 2 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Linux: Firefox exposes reserved Xbox Series buttons and swaps X/YCó thể làm lại được @LizardByte-bot đã nhận 82 ngày trước và không có pull request nào đang mở. Đang mở
LizardByte/libvirtualhid#83 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của LizardByte/libvirtualhid
Issue tương tự
-
[Feature]: Fedora 45 repoĐang mởenhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
metasequoiaime/msime#10989 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
vek-language/vek-lang#1 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
eclipse-score/lifecycle#957 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 62/100
mw00/project-maya#877 ·
Maintainer thường phản hồi trong vòng 1 ngày