Accessing Add/Remove Programs Details

Tim Golden tim.golden at viacom-outdoor.co.uk
Thu Sep 7 11:32:47 CEST 2006


[Phoe6]

| I have to uninstall an application and  I don't find the uninstaller,
| the option available to me is to access Add/Remove Programs, 
| select the
| application and remove from there.
| 
| I am trying to automate this task using Python:
| 1) Get the Application Name
| 2) Access the Add/Remove Program details and check if the application
| is present.
| 3) If present, then uninstall it.
| 
| I want to understand the Python Win32 modules/calls that would helpful
| to me in this direction. Are there any?  I don't want to do it as GUI
| automation using dogtail, as I want to maintain a homogeneous 
| execution
| environment of only CLI.

Not actually tried it myself, but WMI looks like a useful
candidate here:

Bit of an example (the other way round) here:
http://tgolden.sc.sabren.com/python/wmi_cookbook.html#install-a-product

and perhaps you need something like 
this (altho' obviously more sophisticated):
<code>
import wmi

appname = "Python 2.4.3"
c = wmi.WMI ()
for product in c.Win32_Product (Caption=appname):
  print product.Caption
  # product.Uninstall ()

</code>

TJG

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________



More information about the Python-list mailing list