I've read How do I pass msiexec properties to a WiX C# custom action? , but that didn't answer my question, or maybe I just don't see what I am doing wrong. My install package fails to install, and the logs say that my property wasn't found in the custom actions collection. My code is:
<CustomAction Id="SetCustomActionDataValue" Return="check" Property="Itp.Configurator.WixCustomAction" Value="G=G2" />
<CustomAction Id="CreateDatabase" BinaryKey="Binary1" DllEntry="CreateDatabase" Execute="deferred" Return="check" />
<InstallExecuteSequence>
<Custom Action='SetCustomActionDataValue' After="InstallFiles"/>
<Custom Action='CreateDatabase' After="SetCustomActionDataValue">
NOT Installed AND NOT PATCH
</Custom>
</InstallExecuteSequence>
And code inside the custom action is:
string Property1 = session.CustomActionData["G"];
The name of the property in your first element must be exactly the same as the name of the deferred custom action you'd like to pass the value to. So, if the deferred action is CreateDatabase, then the first element should look like this:
<CustomAction Id="SetCustomActionDataValue" Return="check" Property="CreateDatabase" Value="G=G2" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With