I would like to read the MSI file in a MemoryStream (or something similar) and modify it. What is the easiest way to do this without damaging the MSI?
All I need to do is change the value of one of the properties in MSI. I would prefer something in .Net, but I am open to other platforms.
Update:
Here's my working code using the Windows platform SDK, COM link to the Microsoft Windows Installer object library, and the WindowsInstaller namespace:
Installer installer = Activator.CreateInstance(Type.GetTypeFromProgID("WindowsInstaller.Installer")) as Installer; Database msi = installer.OpenDatabase("WixTest.msi", MsiOpenDatabaseMode.msiOpenDatabaseModeTransact); View view = msi.OpenView("update `Property` SET `Property`.`Value`='99' where `Property`='USERID'"); view.Execute(null); msi.Commit();
source share