Saturday, September 25, 2010

Windows Installer Information | C#

When you are working with Installer applications. At times, you may have to find properties of underlying components inside Installer (.msi) packages. MSI does maintain a database of all the properties of underlying items.  

Windowsinstaller can be used to find this information. Usage of the WindowInstaller has already been published in another post.

The below C# method helps you to find a property of an underlying component:
The above method takes two parameters sMsiFilePath - indicates the exact path of the .msi file and sProperty is the name of the property(e.g. Version) to find and returns the the property value as a string.

e.g. GetMSIProperty("C:\Test\Setup.msi", "DisplayVersion"); // to make a call to the above method

No comments :

Post a Comment