Programmatically installing MSI packages

I find the Deployment Tools Foundation project mentioned above to be a solid way to do this from .NET. Having referenced Microsoft.Deployment.WindowsInstaller.dll, use code like this to install a package: Installer.SetInternalUI(InstallUIOptions.Silent); Installer.InstallProduct(msiFilename, “ACTION=INSTALL ALLUSERS=2 MSIINSTALLPERUSER=”); The documentation for the .NET wrapper is in a .chm file in the Windows Installer XML installation directory in Program … Read more

How can I programmatically read the properties inside an MSI file?

You can use the COM-based API for working with MSI, and do something like Function GetVersion(ByVal msiName) Const msiOpenDatabaseModeReadOnly = 0 Dim msi, db, view Set msi = CreateObject(“WindowsInstaller.Installer”) Set db = msi.OpenDataBase(msiName, msiOpenDatabaseModeReadOnly) Set view = db.OpenView(“SELECT `Value` FROM `Property` WHERE `Property` = ‘ProductVersion'”) Call view.Execute() GetVersion = view.Fetch().StringData(1) End Function