Hi there,
I wrote here an application that uses the WUA COM interfaces
(IUpdateSearcher, IUpdate etc.). I use this application to scan for
available updates, download the updates and install them. Everything works
OK until I get to download and install the XP Service Pack 2. I get this
update when I use IUpdateSearcher.Search(), I can successfully download it
(using IUpdateDownloader.Download()) but when I install this update using
IUpdateInstaller2.Install() I cannot get rid of the user interface. When I
launch my tool (a command line tool) the user interface comes up for XP SP2.
My questions are:
- how can I avoid this user interface for XP SP2 from Windows Update Agent
APIs?
- if I run my utility under the SYSTEM account (from a service) then
installation of the XP SP2 will fail with error 0x80240020. Microsoft has an
article about similar problem (
http://support.microsoft.com/?kbid=910341)
but I did all the steps there and I still get the error. I think that the
user interface for XP SP2 should show up but it cannot because my
application is running under the SYSTEM account (however the current logged
on user is an administrator). Any ideas?
Here is the code that I use in my application:
///////////////////////////////////////////////////////////////
Set us = CreateObject("Microsoft.Update.Session")
Set Updates = CreateObject("Microsoft.Update.UpdateColl")
Set Download = us.CreateUpdateDownloader()
Set usearch = us.CreateUpdateSearcher()
Set usresult = usearch.Search("Type='Software' and
UpdateID='7477af62-8f9b-4f32-9daf-7aB452e52396'") ' ID of XP SP2 update
Set ourUpdate = usresult.Updates.Item(a)
Updates.Add (ourUpdate)
Download.Updates = Updates
Set result = Download.Download() ' download works OK
Set Install = us.CreateUpdateInstaller() ' create the installer
Install.ForceQuiet = true
Install.Updates = Updates
Set installed = Install.Install() ' and install the installers.
However for XP SP2 this shows the user interface
' but not for other updates...
//////////////////////////////////////////////////////////////
Thanks for your help.
--------------------------------------------------------------------------
Dorel Sturm
Germany