193 out of 386 rated this helpful - Rate this topic

Updating Windows Update Agent

Windows Update Agent (WUA) automatically updates itself when it is connected to a Windows Server Update Services (WSUS) server or to Windows Update. WUA can also be manually updated by using a signed installation package that is available from Microsoft. The installation package can be used to install the latest released versions of WUA or of the Muauth.cab file. This section explains how you can programmatically determine that version of Windows Update Agent running on the computer is the latest - or at least current enough - version.

Using the WUA API (specifically the IWindowsUpdateAgentInfo::GetInfo method), you can ask Windows Update Agent for the current version. However, there's no way to determine if that version is the latest version. If you use the WUA API to perform a scan/download/install and receive a WU_E_SELFUPDATE_REQUIRED error message, then that's pretty strong evidence that your version of WUA is out of date. However, there's also no way through the WUA API to force a self-update.

Additionally, if Windows Update on the box is in a broken state, so that automatic self-updates are failing, there's no way to use the WUA API to recover from that. So, as a programmer, the only way you can get out of these situations is either to prompt the user to install KB949104 or to manually install the latest WUA.

This leaves you - the programmer - with two fundamental questions:

  • How can my program determine whether or not the running version of WUA is the most recent one (or at least a current one)?
  • If my program determines that the running version of WUA is too old, or that WUA isn't running at all, then how can my program force the most recent version of WUA (or at least a current version of WUA) to be installed?

In order to answer these two questions, the following steps should be taken in your application:

Aa387285.wedge(en-us,VS.85).gifEnsuring that an appropriate version of WUA is installed

  1. Use the WinHTTP API to download http://update.microsoft.com/redist/wuredist.cab.
  2. Use the security API to verify that the downloaded copy of wuredist.cab has a digital signature from Microsoft. If you cannot verify the digital signature, stop.
  3. Use the Microsoft Cabinet SDK to extract the XML file from the wuredist.cab file.
  4. Use the MSXML API to load the XML file and locate the WURedist/StandaloneRedist/architecture node appropriate to the computer's architecture (for example, on an x86 box, locate the WURedist/Standalone/architecture node with the name attribute of "x86").
  5. Call IWindowsUpdateAgentInfo::GetInfo to determine the current version of the Windows Update Agent. If IWindowsUpdateAgentInfo::GetInfo succeeds, and if it returns a version number that is at least as high as the clientVersion attribute in the architecture node you located, then stop.
  6. Use the MSXML API to read the downloadUrl attribute from the architecture node you located; this will give you the download URL for the appropriate Windows Update Agent installer for your architecture.
  7. Use the WinHTTP API to download the appropriate installer.
  8. Use CreateProcess or a similar API call to execute the downloaded installer.

 

 

Send comments about this topic to Microsoft

Build date: 7/7/2011

Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ
Microsoft not clear on latest version of WUA?
When I check http://go.microsoft.com/FWLink/?LinkId=84399. I find the latest versions to be as follows:

<architecture name="x86" clientVersion="7.0.6000.381"
<architecture name="x64" clientVersion="7.0.6000.381"
<architecture name="ia64" clientVersion="7.0.6000.381"

When I check the corresponding KB article http://support.microsoft.com/kb/946928 it says the latest version is 7.2.6001.784

Which one is wrong?


WUA 7.1.6001.65 standalone redistributable installer now available
The WUA 7.1.6001.65 standalone redistributable installer is now available in the following locations:

http://download.windowsupdate.com/WindowsUpdate/redist/standalone/7.1.6001.65/WindowsUpdateAgent30-x86.exe

http://download.windowsupdate.com/WindowsUpdate/redist/standalone/7.1.6001.65/WindowsUpdateAgent30-x64.exe

NB WURedist.cab still points to version 7.0.6000.381 at time of writing (17/6/2008)

windows updater problem
This is far from all the technical jargon I have seen here.But this might help some people who are having trouble with the windows updater.Im have win7 and up until recently it worked fine.I do not know if because other programs I installed but it faile to work.I recieved a error like it was not working at the time.After trying to figure out what link was the right one for my computer.I finnally went to control panel and clicked on the system and security link and just ran the fix program.It seemed to fix the program for now.
WUA 7.2.6001.784 Standalone Redistributable
Once again MS has its head up its ***, I am here Sat night tryng to install office07, I have been playing with signverf and CATROOT, now running update on the installer. does guys who own Mac got throught this troiuble?
WU Agent

WU Agent
MBSA: An error occurred while scanning for security updates. (0x8024001f)
Hi,

I am wondering if anyone faces this error when you try to do a mbsa scan using mbsacli?

I have downloaded the latest wsusscn2.cab file and windows update agent30x86 (version 7.4.7600:226). It was running fine when I installed windows update agent30x86 (version 7.0.6000:374).

The operating system being used here is Windows server 2003.

Appreciate if anyone could provide me with some solutions to this issue.

Thanks.
Force install of already downloaded updates
Hi Team,

I have already downloaded my updates to a network shared path. All I want to do is to install these patches on any of the system over the LAN.

I was not able to create UpdateToInstall collection manually.

Does anyone know how i would go about scripting this.

Thanks in advance
Kalyan
Where's the new docs 7.4.7600.226 is out
KB này là hết hạn:
http://support.microsoft.com/kb/949104

Các wuredist.xml bên trong http://update.microsoft.com/redist/wuredist.cab cũng đã quá hạn (báo cáo 7.2.6001.788)

Vì vậy, chúng tôi đang còn lại để hackery để tìm ra những phiên bản mới nhất là ....

WSUS ở đây là phân phối 7.4.7600.226 kể từ cuối vài ngày
Dù sao, ba liên kết hiện nay là:
x86:


WUredist.cab updated!

WUredist.cab was updated on May 1st 2007 to provide links to the WSUS 3.0 WUA client (7.0.6000.374).

WUredist.cab updated, version is now 7.0.6000.381

WSUS 3.0 SP1 - v 7.1.6001.65

WSUS 3.0 SP1 is now providing 7.1.6001.65 - when will this be available on as a redistributable installer as described in this article?