[wpkg-users] Uninstall prohbited Applications
Дубовский А.Г.
A.Dubovskiy at gedore.ru
Thu Sep 16 06:31:59 CEST 2010
To uninstall prohibited applications I've developed a little script. Its convenience is the fact that you can specify a mask to uninstall the programs like "Adobe%".
Its disadvantages are the relatively large time to check prohibited applications.
Set theSoftware = objWMICall.ExecQuery ("select * from Win32_Product Where " & SoftList)
Maybe a developers come up to integrate into WPKG uninstall prohibited applications, or speed up apps checking with "like" feature.
The beauty WMICall.Uninstall() lies in the fact that it is looking for a UninstallString and uninstall application quiet.
ProhibitedApplications.vbs
________________________________
theFile = "\\MyServerIp\DEPLOY$\wpkg\ProhibitedApplications <file://myserverip/DEPLOY$/wpkg/ProhibitedPackages> .xml"
Set fso = CreateObject("Scripting.FileSystemObject")
if fso.FileExists(theFile) then
xmlDoc.Load(theFile)
WhereList=""
for each theNode in xmlDoc.documentElement.childNodes
if WhereList<>"" then WhereList=WhereList & " or "
theUninst = theNode.NodeTypedValue
if Instr(theUninst,"%")>0 then
WhereList=WhereList & "Name like '" & theUninst & "'"
else
WhereList=WhereList & "Name ='" & theUninst &"'"
end if
next
if WhereList<>"" then
Set theSoftware = objWMICall.ExecQuery ("select * from Win32_Product Where " & SoftList)
For Each SoftwareComponent in theSoftware
SoftwareComponent.Uninstall()
Next
end if
end if
________________________________
ProhibitedApplications.xml <file://\\MyServerIp\DEPLOY$\wpkg\ProhibitedApplications.xml > - EXAMPLE. If Uninstall value contain "%", it uninstall all by mask
<file://\\MyServerIp\DEPLOY$\wpkg\ProhibitedPackages.pkg>
________________________________
<?xml version="1.0" encoding="UTF-8"?>
<Applications>
<Uninstall>%Punto%</Uninstall>
<Uninstall>Acrobat.com</Uninstall>
<Uninstall>Adobe Reader%</Uninstall>
<Uninstall>Mail.Ru%</Uninstall>
<Uninstall>Microsoft Firewall Client%</Uninstall>
<Uninstall>Ask Toolbar%</Uninstall>
</Applications>
________________________________
with regards,
Alexey Dubovsky
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.wpkg.org/pipermail/wpkg-users/attachments/20100916/1cb9d8d0/attachment-0001.html>
More information about the wpkg-users
mailing list