Repository navigation
fix(windows): handle driver reinstalls with active consumers - #216
Open
ReenigneArcher wants to merge 5 commits into
Open
ReenigneArcher wants to merge 5 commits into
ReenigneArcher wants to merge 5 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #216 +/- ##
==========================================
+ Coverage 73.61% 73.75% +0.14%
==========================================
Files 44 44
Lines 10705 10735 +30
Branches 3651 3651
==========================================
+ Hits 7880 7918 +38
- Misses 2428 2439 +11
+ Partials 397 378 -19
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 9 files with indirect coverage changes Continue to review full report in Codecov by Harness.
|
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
Reinstalling or upgrading the Windows driver could fail with MSI Error 1722 because the broker was stopped only after the driver update and device restart. Its open device handle could veto the reload, leaving the device pending reboot and causing subsequent restart attempts to fail.
Stop the broker before changing any device and register/start it after the driver update. Skip further device restarts when SetupAPI requires a reboot, and treat PnPUtil's reboot-required or unsupported-restart results as a deferred reload with a warning. Broker reconfiguration uses
Win32_Service.Changeto preserve the quoted executable path withoutsc.exeargument parsing, which failed on Windows Server 2022 with exit code 1639. Native stderr is collected before interpreting reboot exit codes in Windows PowerShell 5.1. Other installation failures remain fatal, and a previously running broker is restored if the update fails. Record installation errors before stopping transcription, with a file-log fallback when transcription is unavailable.Explicitly register
SunshineServiceandsunshine.exewith Windows Installer's Restart Manager beforeInstallValidate, so running Sunshine instances appear in the standard applications-to-close dialog even though their device handles do not lock MSI-owned files. Use the WiX Util extension for the registrations and document that closing Sunshine ends active streams. Silent installation follows Windows Installer's Restart Manager policy.Add installed-MSI regression checks for Sunshine shutdown and for repair while a consumer handle is open and the broker is running. Deferred driver reload requirements are recorded as log warnings.
Screenshot
Issues Fixed or Closed
Roadmap Issues
Testing
tests/scriptspassed. Regression coverage includes broker shutdown before update/stale-device removal, reboot deferral (exit codes 50 and 3010), fatal update failures, broker restoration, stage-only behavior, fallback error logging, CIM service reconfiguration, and native stderr with reboot exit codes.-WhatIfagainst the real installed INF, setup helper, and broker paths; passed without changing the installation.scripts/windows/test-installed-driver.ps1 -Verbose; the existing root device was started and the control device opened successfully.actionlint1.7.12, strict yamllint 1.38.0 using the CI configuration, PowerShell parsing of the CI repair step, andgit diff --check: passed.sunshine.exefixture, gamepad profile checks, repair with a running broker and an open consumer handle, and uninstall cleanup. Local MSI validation used-WhatIfbecause the session lacks administrator elevation. CI captures PowerShell Operational errors when file transcription is unavailable.Type of Change
Checklist
AI Usage
See our AI usage policy.
Generated with Codex using GPT-6.1 Sol (
gpt-6.1-sol), thinking level:xhigh.