Help! I am working on a corporate deployment of JRE V1.4.2_04. I
would like to programmatically uninstall all previous versions of
Java. Is there an easier way to manually remove all previous versions
without having to:
1) Enumerate all Uninstall registry keys in Registry
2) Kicking off uninstall strings (create response files if necessary)
This approach is messy and I have no way of knowing all previous
versions of SUN JRE released.
Should I leave existing versions on the workstation? I would like to
keep a corporate standard. Any help on this topic would be GREATLY
appreciated. Thanks.
Have you looked at Windows Management Instrumentation? WMI knows
about installed products and can manipulate them. For example,
wmi_service.ExecQuery("SELECT * FROM Win32_Product")
(where wmi_service is a connection to WMI on the target host) will
return an enumeration known installed products. If you have some way
to recognize the products you want to get rid of, walk the collection
and call the Uninstall() method of each matching object.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/wmi_
start_page.asp

Signature
Mark H. Wood, Lead System Programmer mwood@IUPUI.Edu
Open-source executable: $0.00. Source: $0.00 Control: priceless!