I'm trying to create a custom action with "Value" attribute, I want to pass parameters to the C# code (the TARGETDIR and the version).
However, I get an error stating that DLLENtry and Value cannot coexist. But the custom action without dllentry is invalid.
This is the code:
<CustomAction Id="SetMAWPrefferences"
Value="InstallDir=[TARGETDIR];Version=2.0.0.1"
Return="check"
Execute="commit"
BinaryKey="ImportExportBinary"
/>
And for it I get this error:
Error 9 ICE68: Invalid custom action type for action 'SetMAWPrefferences'.
Any ideas how to do it?
Note, you're using
Value
attribute in the wrong way:Based on the Creating WiX Custom Actions in C# and Passing Parameters article you should:
Create properties with desired values:
Create custom action to set the
InstallDir
property:Create custom action:
Schedule custom actions for execution during installation process:
Access those properties from your custom action as follows: