【问题标题】:How windows update agent WUA identify KB's to be installed?Windows 更新代理 WUA 如何识别要安装的 KB?
【发布时间】:2019-08-09 19:01:20
【问题描述】:

我试图找出适用于给定系统的更新?我看到了WUA Api 调用页面。我想知道 Windows 更新代理是如何工作的? windows如何决定他们需要安装哪些KB?有没有像注册表这样的中心位置,我知道安装了不同的组件或默认带有版本信息?然后决定补丁?

例如,要安装dot net KB或IE KB,如何在系统上首先找到dot net、IE、vbscript之类的组件?

有什么想法吗?

【问题讨论】:

  • 请编辑问题以将其限制为具有足够详细信息的特定问题,以确定适当的答案。避免一次问多个不同的问题。这个问题太宽泛了,无法回答!

标签: windows-update


【解决方案1】:

客户端中 WUA API 的IUpdateSearcher 接口调用远程通信协议(基于 HTTP 上的 SOAP XML),该协议与 Microsoft 的公共 Windows Update 服务器或可选的本地 Windows Server Update Services (WSUS) 服务器进行通信.

WSUS 充当 Microsoft 公共 Windows 更新服务器的代理。 WSUS 服务器通过 Internet 从 Windows Update 服务器获取更新并在本地缓存它们。然后将基于 Intranet 的 PC 配置为从 WSUS 服务器获取更新。 WSUS 服务器的地址是使用以下注册表项配置的:
HKEY_LOCAL_MACHINE\Software\Policies\Microsoft\Windows\WindowsUpdate\WUServer

此协议的一部分涉及将操作系统配置数据和已安装更新(和硬件)的分类列表传输到服务器。请参阅此通信协议的RegisterComputerSynchUpdates 消息,描述于:
https://winprotocoldoc.blob.core.windows.net/productionwindowsarchives/MS-WUSP/%5bMS-WUSP%5d.pdf

根据客户端在这些消息中提供给更新服务器的信息,服务器会回复更新中适用的更新列表 SyncUpdates Response 消息。

...如果 WUA 通过IUpdateServiceManager.AddScanPackageService() API 方法使用本地离线扫描包WSUSSCN2.CAB 来发现适用的更新,而无需任何连接到 Internet,则它使用包含在此中的 XML 文件包确定适用性。例如,请查看以下 WSUSSCN2.CAB 文件片段中的 XML 标记 <upd:ApplicabilityRules><upd:IsInstallable>

<upd:Update xmlns:pub="http://schemas.microsoft.com/msus/2002/12/Publishing" xmlns:cmd="http://schemas.microsoft.com/msus/2002/12/UpdateHandlers/CommandLineInstallation" xmlns:bar="http://schemas.microsoft.com/msus/2002/12/BaseApplicabilityRules" xmlns:lar="http://schemas.microsoft.com/msus/2002/12/LogicalApplicabilityRules" xmlns:upd="http://schemas.microsoft.com/msus/2002/12/Update">
<upd:UpdateIdentity UpdateID="e55001a2-1fdd-4472-9c3c-b1e301460985" RevisionNumber="106" />
<upd:Properties DefaultPropertiesLanguage="en" UpdateType="Software" Handler="http://schemas.microsoft.com/msus/2002/12/UpdateHandlers/CommandLineInstallation" PublicationState="Published" CreationDate="2009-04-27T21:44:22.464Z" PublisherID="395392a0-19c0-48b7-a927-f7c15066d905" MaxDownloadSize="6528440" MinDownloadSize="0">
    <upd:InstallationBehavior RebootBehavior="CanRequestReboot" />
    <upd:Language>zh-cn</upd:Language>
</upd:Properties>
<upd:LocalizedPropertiesCollection>
    <upd:LocalizedProperties>
        <upd:Language>en</upd:Language>
        <upd:Title>CHS</upd:Title>
    </upd:LocalizedProperties>
</upd:LocalizedPropertiesCollection>
<upd:Relationships>
    <upd:Prerequisites>

        <upd:AtLeastOne>
            <upd:UpdateIdentity UpdateID="5b56a815-2aef-40dc-9960-36bac15d1818" />
            <upd:UpdateIdentity UpdateID="cf3b8086-5954-4857-b492-339cbdeba89b" />              
        </upd:AtLeastOne>

        <upd:AtLeastOne>
            <upd:UpdateIdentity UpdateID="59653007-e2e9-4f71-8525-2ff588527978" />
            <upd:UpdateIdentity UpdateID="aabd43ad-a183-4f0b-8eee-8dbbcd67687f" />
            <upd:UpdateIdentity UpdateID="3e0afb10-a9fb-4c16-a60e-5790c3803437" />
        </upd:AtLeastOne>

        <upd:AtLeastOne>
            <upd:UpdateIdentity UpdateID="3b4b8621-726e-43a6-b43b-37d07ec7019f" />
            <upd:UpdateIdentity UpdateID="dbf57a08-0d5a-46ff-b30c-7715eb9498e9" />
            <upd:UpdateIdentity UpdateID="26997d30-08ce-4f25-b2de-699c36a8033a" />              
        </upd:AtLeastOne>

    </upd:Prerequisites>
</upd:Relationships>

<upd:ApplicabilityRules>

    <upd:IsInstalled>
        <lar:And xmlns:lar="http://schemas.microsoft.com/msus/2002/12/LogicalApplicabilityRules">
            <bar:FileExists Path="Microsoft.NET\Framework\v1.0.3705\System.Web.dll" Csidl="36" xmlns:bar="http://schemas.microsoft.com/msus/2002/12/BaseApplicabilityRules" />
            <bar:FileVersion Path="Microsoft.NET\Framework\v1.0.3705\System.Web.dll" Comparison="GreaterThanOrEqualTo" Version="1.0.3705.6060" Csidl="36" xmlns:bar="http://schemas.microsoft.com/msus/2002/12/BaseApplicabilityRules" />
            <bar:RegKeyExists Key="HKEY_LOCAL_MACHINE" Subkey="Software\Microsoft\Active Setup\Installed Components\{3351022E-A2D8-4B52-B84D-491279866457}" RegType32="true" xmlns:bar="http://schemas.microsoft.com/msus/2002/12/BaseApplicabilityRules" />
        </lar:And>
    </upd:IsInstalled>

    <upd:IsInstallable>
        <lar:And xmlns:lar="http://schemas.microsoft.com/msus/2002/12/LogicalApplicabilityRules">
            <bar:RegKeyExists Key="HKEY_LOCAL_MACHINE" Subkey="Software\Microsoft\Active Setup\Installed Components\{3351022E-A2D8-4B52-B84D-491279866457}" RegType32="true" xmlns:bar="http://schemas.microsoft.com/msus/2002/12/BaseApplicabilityRules" />
            <lar:Not>
                <bar:RegDword Key="HKEY_LOCAL_MACHINE" Subkey="SYSTEM\WPA\TabletPC" Value="Installed" Comparison="EqualTo" Data="1" xmlns:bar="http://schemas.microsoft.com/msus/2002/12/BaseApplicabilityRules" />
            </lar:Not>
            <lar:Not>
                <bar:RegDword Key="HKEY_LOCAL_MACHINE" Subkey="SYSTEM\WPA\MediaCenter" Value="Installed" Comparison="EqualTo" Data="1" xmlns:bar="http://schemas.microsoft.com/msus/2002/12/BaseApplicabilityRules" />
            </lar:Not>
        </lar:And>
    </upd:IsInstallable>

</upd:ApplicabilityRules>

<upd:Files>
    <upd:File Digest="oYIv8m/lHbAFWB1MhR14EjvPIzc=" DigestAlgorithm="SHA1" FileName="NDP1.0sp3-KB928367-X86-Chs.exe" Size="6528440" Modified="2007-06-29T14:59:22.47" />
</upd:Files>

<upd:HandlerSpecificData xsi:type="cmd:CommandLineInstallation" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:pub="http://schemas.microsoft.com/msus/2002/12/Publishing">
    <cmd:InstallCommand Arguments="-q" Program="NDP1.0sp3-KB928367-X86-Chs.exe" RebootByDefault="false" DefaultResult="Failed" xmlns:cmd="http://schemas.microsoft.com/msus/2002/12/UpdateHandlers/CommandLineInstallation">
        <cmd:ReturnCode Reboot="false" Result="Succeeded" Code="0" />
        <cmd:ReturnCode Reboot="true" Result="Succeeded" Code="3010" />
        <cmd:ReturnCode Reboot="true" Result="Succeeded" Code="1641" />
    </cmd:InstallCommand>
</upd:HandlerSpecificData>
</upd:Update>

补充说明:
用水户协会不将其数据库保存在注册表中。它保存在 JetBlue ESE 数据库文件中:%SystemRoot%\SoftwareDistribution\DataStore\DataStore.edb

WUA 不通过知识库 (KB) 编号识别更新,而是通过基于 SHA1 的 GUID,如下所示:“5b56a815-2aef-40dc-9960-36bac15d1818”。
您可以在上面的 XML 片段中看到这些 GUID您可以通过 WUA API IUpdate.get_Identity() 获取。

【讨论】:

    猜你喜欢
    • 2015-02-04
    • 2018-03-07
    • 2020-04-10
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-06-18
    • 2018-10-25
    相关资源
    最近更新 更多