Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Windows Update Agent API - download links / installation

863 views
Skip to first unread message

PaqDev

unread,
Mar 3, 2008, 8:47:16 PM3/3/08
to
I am using the Windows Update Agent API and the WSUSSCN2.CAB file to scan for
missing updates on machines that do not have Internet access. The scans work
fine. Since I cannot use the WUA API to download and install the updates (no
Internet connection), I obtain the patch download links for the missing
updates via the WUA API. I then use these download links to download the
update installation files onto a server that has Internet access and then
copy the updates from this server to the machine that does not have Internet
access. I then simply shell out and execute the update files one at a time.

The problem I have is that the download links provided by the WUA API are
sometimes for CAB files rather than for EXE/MSI/MSU files. This occurs mostly
in Vista machines, but I have run across other cases. So, I cannot just
shell out to install these updates. I know that if I go to the Microsoft
site to manually download an update, I will get an EXE/MSI/MSU file rather
than a CAB file.

Is there some way to obtain the download links for EXE/MSI/MSU files via the
WUA API rather than the links for CAB files? Alternatively, is there some
way to get the installer in WUA API to install one of these CAB files by
providing a location on the local machine to which the CAB file was copied
without having to use the WUA API to actually perform the download? I have
not found anything in the WUA API documentation that deals with these
questions.

Unknown

unread,
Mar 3, 2008, 11:11:00 PM3/3/08
to

Robert Aldwinckle

unread,
Mar 5, 2008, 12:39:44 PM3/5/08
to
(cross-post added to WSUS)
"PaqDev" <Paq...@discussions.microsoft.com> wrote in message
news:ACC76362-83C0-4BA6...@microsoft.com...

>I am using the Windows Update Agent API and the WSUSSCN2.CAB file to scan for
> missing updates on machines that do not have Internet access. The scans work
> fine. Since I cannot use the WUA API to download and install the updates (no
> Internet connection),


You don't need an Internet connection to network two PCs.

> I obtain the patch download links for the missing
> updates via the WUA API. I then use these download links to download the
> update installation files onto a server that has Internet access and then
> copy the updates from this server to the machine that does not have Internet
> access. I then simply shell out and execute the update files one at a time.


I suspect you are making things more difficult for yourself than you need to.
Cross-posting to WSUS.


Good luck

Robert Aldwinckle
---

Harry Johnston [MVP]

unread,
Mar 5, 2008, 5:29:08 PM3/5/08
to

> "PaqDev" <Paq...@discussions.microsoft.com> wrote in message
> news:ACC76362-83C0-4BA6...@microsoft.com...

>> I am using the Windows Update Agent API and the WSUSSCN2.CAB file to scan for
>> missing updates on machines that do not have Internet access. The scans work
>> fine. Since I cannot use the WUA API to download and install the updates (no
>> Internet connection),

>> I obtain the patch download links for the missing
>> updates via the WUA API. I then use these download links to download the
>> update installation files onto a server that has Internet access and then
>> copy the updates from this server to the machine that does not have Internet
>> access. I then simply shell out and execute the update files one at a time.

It may be worth investigating WSUS. Start here:

<http://technet.microsoft.com/en-us/wsus/default.aspx>

If you're determined to use the WUA API, it should be possible to
reverse-engineer the way the CAB files are installed. Look at the content from
a few of them and I'd guess it will be fairly obvious how to install them.

Harry.

PaqDev

unread,
Mar 7, 2008, 9:38:00 PM3/7/08
to
Thanks for the reply.

I already had tried the "reverse-engineer" approach, but the WUA API
download object does a lot more than just download the CAB file. It creates
files and/or directories under the <Windows>\SoftwareDistribution\Download
directory that are anything but obvious, and it makes entries in a database
(<Windows>\SoftwareDistribution\DataStore\DataStore.edb) concerning the
download for use by the WUA API installer object. Unfortunately, I haven't
found any documentation for any of this. I had hoped that in MS's new spirit
of open documentation, someone might have found something on this that I
haven't discovered.

Thanks again.

Harry Johnston [MVP]

unread,
Mar 8, 2008, 11:08:26 AM3/8/08
to
PaqDev wrote:

> I already had tried the "reverse-engineer" approach, but the WUA API
> download object does a lot more than just download the CAB file. It creates
> files and/or directories under the <Windows>\SoftwareDistribution\Download
> directory that are anything but obvious, and it makes entries in a database
> (<Windows>\SoftwareDistribution\DataStore\DataStore.edb) concerning the
> download for use by the WUA API installer object. Unfortunately, I haven't
> found any documentation for any of this.

No, it'll be an internal mechanism, subject to change.

The WUA API includes import and export functions; have you tried using these?

Harry.

PaqDev

unread,
Mar 10, 2008, 9:50:00 PM3/10/08
to
I haven't found anything concerning import and export functions in the WUA
API documentation. I hate to be a pain, but can you point me someplace?
Thanks!

Harry Johnston [MVP]

unread,
Mar 11, 2008, 8:41:21 PM3/11/08
to
PaqDev wrote:

> I haven't found anything concerning import and export functions in the WUA
> API documentation. I hate to be a pain, but can you point me someplace?
> Thanks!

I can't find the methods I was thinking of - perhaps they're gone, perhaps I'm
looking in the wrong place - but these might (perhaps) present a solution:

<http://msdn2.microsoft.com/en-us/library/aa386884(VS.85).aspx>

<http://msdn2.microsoft.com/en-us/library/aa386101(VS.85).aspx>

Remember that the offline catalog isn't really designed for this purpose so you
may be out of luck.

Harry.

Lawrence Garvin [MVP]

unread,
Mar 12, 2008, 8:32:10 PM3/12/08
to
"Harry Johnston [MVP]" <ha...@scms.waikato.ac.nz> wrote in message
news:OgX$Ln9gIH...@TK2MSFTNGP05.phx.gbl...

> PaqDev wrote:
>
>> I haven't found anything concerning import and export functions in the
>> WUA API documentation. I hate to be a pain, but can you point me
>> someplace? Thanks!
>
> I can't find the methods I was thinking of - perhaps they're gone, perhaps
> I'm looking in the wrong place - but these might (perhaps) present a
> solution:

Any documentation concerning import/export functionality of WSUS would be in
the =WSUS= SDK, not the WUA SDK.


--
Lawrence Garvin, M.S., MCBMSP, MCTS(x4), MCP
Senior Data Architect, APQC, Houston, Texas
Microsoft MVP - Software Distribution (2005-2008)

MS WSUS Website: http://www.microsoft.com/wsus
My Websites: http://www.onsitechsolutions.com;
http://wsusinfo.onsitechsolutions.com
My MVP Profile: http://mvp.support.microsoft.com/profile/Lawrence.Garvin

Harry Johnston [MVP]

unread,
Mar 12, 2008, 9:21:27 PM3/12/08
to
Lawrence Garvin [MVP] wrote:

>>> I haven't found anything concerning import and export functions in
>>> the WUA API documentation. I hate to be a pain, but can you point me
>>> someplace? Thanks!
>>
>> I can't find the methods I was thinking of - perhaps they're gone,
>> perhaps I'm looking in the wrong place - but these might (perhaps)
>> present a solution:
>
> Any documentation concerning import/export functionality of WSUS would
> be in the =WSUS= SDK, not the WUA SDK.

You're thinking of import/export of the WSUS database. We're talking about
packages on the client side.

I found the thread I was looking for, once I realised it was in
microsoft.public.security.baseline_analyzer rather than here. Turns out the
methods were CopyToCache and CopyFromCache; I was misremembering the names.

Harry.

Harry Johnston [MVP]

unread,
Mar 12, 2008, 9:26:33 PM3/12/08
to
Harry Johnston [MVP] wrote:

> I can't find the methods I was thinking of - perhaps they're gone,
> perhaps I'm looking in the wrong place - but these might (perhaps)
> present a solution:
>
> <http://msdn2.microsoft.com/en-us/library/aa386884(VS.85).aspx>
>
> <http://msdn2.microsoft.com/en-us/library/aa386101(VS.85).aspx>

I found the thread I'd been looking for. These are the references:

<http://msdn2.microsoft.com/en-us/library/aa386878(VS.85).aspx>

<http://msdn2.microsoft.com/en-us/library/aa386101(VS.85).aspx>

Seems I'd misremembered the method names so I was looking for the wrong thing.

The documentation doesn't really make it clear exactly how these methods
interact with the rest of the system or what their intended purpose is, so I'm
unsure whether they'll be useful or not.

... if you do get this working, I for one would be very interested to hear
about it, and to see the code if you are willing to release it.

Harry.

PaqDev

unread,
Mar 13, 2008, 4:14:00 PM3/13/08
to
Thanks for your responses! I am using the DownloadContents to get the
download links. But, the CopyToCache method is interesting. I had not
really looked at that before, so I'll do some experimenting with it. If I
can figure out something with it, I'll be happy to post my results!

Thanks again!

Tim

unread,
May 5, 2009, 3:16:01 AM5/5/09
to
Hi PaqDev,
How is this subject going? I have the same problem with you. I wish
you can share more information. Thanks.

I want to using WUA API in visual studio 6.0 . I have to add WUapi.h
and Wuguid.lib to my c++ project. but when I call
IUpdateServiceManager::AddScanPackageService() , I get a error that indicate
E_INVALIDARG .

do you have any surguesstion?

Gary

unread,
Jun 22, 2009, 5:00:01 AM6/22/09
to

Hi,Ihave the similar problem,I wish you could share more information about
this subject.such as IUpdate::CopyFromCache.
0 new messages