views:

32

answers:

1

How can i using c# find out information on the windows installer(msi) program was installed on ?

to try to explain this better, i want to be able to look at a program say WINWORD.EXE and find information on the windows installer it was installed with. i know windows keep a log of this in the registery

Thank you

+1  A: 

First, you'll need to find the Component GUID that installed the file you are interested in. There is no API to do this so you'd either have to know the Component GUID or do a bunch of MSI File/Directory table resolution. I recommend just knowing the Component GUID because it shouldn't change once the Product is installed.

Then you can use ::MsiEnumClients() to find the ProductCode. With the ProductCode in hand now you can get all kinds of information about the installed MSI.

Rob Mensching