From 43157a1d37d3d87cfac1057b48a4c36474a2271d Mon Sep 17 00:00:00 2001 From: 5tuk0v <90915844+5tuk0v@users.noreply.github.com> Date: Sat, 21 Feb 2026 22:48:23 -0500 Subject: [PATCH] fix: restore compatibility with modern Windows Update clients MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Remove hardcoded Prerequisites category UUID (0fa1201d) from sync-updates.xml — modern WU clients no longer satisfy this category, causing updates to be silently marked non-applicable - Populate in get-config.xml with required protocol negotiation fields (ProtocolVersion, MaxExtendedUpdatesPerRequest, IsInventoryRequired, ClientReportingLevel) — absence causes 0x8024402a on current WU client versions - Catch ConnectionResetError/BrokenPipeError on EXE send in do_GET — suppresses noisy traceback from BITS range-request probe - Bump lxml to >=4.9.2 to fix build failure on Python 3.11+ Tested on: Windows 10 22H2, Windows 11 24H2, Windows Server 2019, Windows Server 2022 --- pywsus.py | 5 ++++- requirements.txt | 2 +- resources/get-config.xml | 2 +- resources/sync-updates.xml | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/pywsus.py b/pywsus.py index 21ee579..a090681 100644 --- a/pywsus.py +++ b/pywsus.py @@ -140,7 +140,10 @@ def do_GET(self): logging.info("Requested: {path}".format(path=self.path)) self._set_response(True) - self.wfile.write(update_handler.executable) + try: + self.wfile.write(update_handler.executable) + except (ConnectionResetError, BrokenPipeError): + logging.debug("Connection reset during EXE send (BITS probe, normal)") def do_POST(self): diff --git a/requirements.txt b/requirements.txt index 79e47c6..e4c98a5 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,3 @@ beautifulsoup4==4.9.1 -lxml==4.6.2 +lxml>=4.9.2 soupsieve==2.0.1 diff --git a/resources/get-config.xml b/resources/get-config.xml index 9fa5bf2..5276315 100644 --- a/resources/get-config.xml +++ b/resources/get-config.xml @@ -1 +1 @@ -{lastChange}falseAnonymous +{lastChange}falseAnonymousProtocolVersion3.2MaxExtendedUpdatesPerRequest20IsInventoryRequired0ClientReportingLevel2 diff --git a/resources/sync-updates.xml b/resources/sync-updates.xml index 09e607f..f45ece6 100644 --- a/resources/sync-updates.xml +++ b/resources/sync-updates.xml @@ -1 +1 @@ -{revision_id1}{deployment_id1}Installtrue2020-02-29000true<UpdateIdentity UpdateID="{uuid1}" RevisionNumber="204" /><Properties UpdateType="Software" ExplicitlyDeployable="true" AutoSelectOnWebSites="true" /><Relationships><Prerequisites><AtLeastOne IsCategory="true"><UpdateIdentity UpdateID="0fa1201d-4330-4fa8-8ae9-b877473b6441" /></AtLeastOne></Prerequisites><BundledUpdates><UpdateIdentity UpdateID="{uuid2}" RevisionNumber="204" /></BundledUpdates></Relationships>{revision_id2}{deployment_id2}Bundletrue2020-02-29000true<UpdateIdentity UpdateID="{uuid2}" RevisionNumber="204" /><Properties UpdateType="Software" /><Relationships></Relationships><ApplicabilityRules><IsInstalled><False /></IsInstalled><IsInstallable><True /></IsInstallable></ApplicabilityRules>false{expire}{cookie}true +{revision_id1}{deployment_id1}Installtrue2020-02-29000true<UpdateIdentity UpdateID="{uuid1}" RevisionNumber="204" /><Properties UpdateType="Software" ExplicitlyDeployable="true" AutoSelectOnWebSites="true" /><Relationships><BundledUpdates><UpdateIdentity UpdateID="{uuid2}" RevisionNumber="204" /></BundledUpdates></Relationships>{revision_id2}{deployment_id2}Bundletrue2020-02-29000true<UpdateIdentity UpdateID="{uuid2}" RevisionNumber="204" /><Properties UpdateType="Software" /><Relationships></Relationships><ApplicabilityRules><IsInstalled><False /></IsInstalled><IsInstallable><True /></IsInstallable></ApplicabilityRules>false{expire}{cookie}true