action1How do I set a MSI property from within a C# custom action, so far I have this but how do I get the handle?
[DllImport("msi.dll", CharSet = CharSet.Unicode)]
static extern int MsiSetProperty(IntPtr hInstall, string szName, string szValue);
public void SetProperty(string propertyName, string propertyValue)
{
MsiSetProperty(handle, propertyName, propertyValue);
}
I am calling the CA from WiX with the following line
<CustomAction Id="CA1" BinaryKey="ca1.dll" DllEntry="action1" />
and the action1 looks like this
public class CustomActions
{
[CustomAction]
public static ActionResult action1(Session session)
{
session.Log("Begin action1");
SetProperty("xyz", "123");
}
}