Hi
We're working with the WUA SDK 2.0, in this case, from Visual Basic 6.0.
When processing updates, we are looping through an enumeration of IUpdate
interfaces, and can pull values for many things--but .UninstallationBehavior
is always coming up as Nothing in VB. It should be essentially the same as
the InstallationBehavior interface, except holding details for
uninstallation. There is nothing in the SDK docs indicating this should be
Nothing, or what that means.
This is true for all patches required on two different machines running
Windows XP SP 2.
Set ssn = CreateObject("Microsoft.Update.Session")
Set searcher = ssn.CreateUpdateSearcher()
Set mgr = CreateObject("Microsoft.Update.ServiceManager")
Set svc = mgr.AddScanPackageService("Scan", "d:\temp\wsusscan.cab")
searcher.Online = FALSE ' can not go online
searcher.CanAutomaticallyUpgradeService = FALSE ' can not upgrade WUA
searcher.ServiceID = svc.ServiceID ' searcher to use Scan Service
Set results = searcher.Search("IsInstalled=0")
If results.Updates.Count = 0 Then
WScript.Quit
End If
Set updates = results.Updates
For i = 0 to updates.Count-1
Set an_update = updates.Item(i)
MsgBox an_update.Title & "--" & an_update.Identity.UpdateID
If ( an_update.UninstallationBehavior is nothing ) Then
MsgBox ".UninstallationBehavior is Nothing"
Else
MsgBox "UpdateInfo.UninstallationBehavior.CanRequestUserI nput: " &
an_update.UninstallationBehavior.CanRequestUserInp ut
End If
Next
WScript.Quit
Thanks
Patrick
|