views:

193

answers:

2

I know that all installed programs and updates can be found at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall key in the registry.

But how can I differentiate between installed programs and installed updates?

+1  A: 

I believe that updates have a value for the (Default) which generally begins with KB. A real install would have a DisplayName. Also, I would ignore things with SystemComponent set to 1.

Michael Dillon
This seems like a reasonable approach. A review of my own registry confirms that updates have a KB* value for (Default).
Corin
A: 

Call MsiEnumProducts() will give you the product code of all the installed products on the system. For each installed product, call MsiGetProductInfo() will give you information about that product.

This is more straight forward solution than using registry based solution.

This should be a good start point:

I believe you can call c++ functions from c#.

vrrathod