Been a while since I looked at this, I'll just point you to two previous answers.
Important!: You should always avoid post-processing the MSI if you can. You can create an MST (transform) to add this to the MSI during installation or set it as a property at the command line. See this old answer: Transforms and PUBLIC PROPERTIES: heavy-weight and light-weight customization of MSI installers and from section "Customizing Silent Install" onwards.
VBScript: There is a VBScript WiRunSQL.vbs
- which is part of the Windows SDK - just search your SDK folder if you have Visual Studio installed.
You can use this and a batch file to post-process an MSI (sample here):
cscript.exe "%~dp0"\WiRunSQL.vbs "MySetup.msi" "INSERT INTO `Property` (`Property`, `Value`) VALUES ('MYPROPERTY', 'PropertyValue')"
pause
There is a previous answer here on how to change things in the ControlCondition table.
C#: There is also some C# code here you can test. Not that well tested, and not the greatest code overall, but have a look?
Alternatively try this source. You need to know what DTF is for this source. What is DTF? DTF is included in the code by this reference: using Microsoft.Deployment.WindowsInstaller;
Briefly inlined:
public static void Set(string msi, string name, string value)
{
using (Database db = new Database(msi, DatabaseOpenMode.Direct))
{
db.Execute("UPDATE `Property` SET `Value` = '{0}' WHERE `Property` = '{1}'", value, name);
}
}
Some Links: