WiX customaction doesnot have value for session.Property["CustomActionData"]

702 Views Asked by At

I have to pass a value to my custom action in patch release for my feature. I did some research and did the following:

<CustomAction Id="CustomAction1" Property="customaction2" Value="Value1" />

<CustomAction Id="customaction2" BinaryKey="Binary.dll" 
                  DllEntry="Functionname" Impersonate="no"
                  Execute="immediate" Return="check" />

I also updated the installExecuteSequence as below:

<Custom Action='CustomAction1' After="InstallFinalize"><![CDATA[PATCH]]></Custom>
<Custom Action='customaction2' After="CustomAction1"><![CDATA[PATCH]]></Custom>

I also added the componentrefs to the patch.wxs file.

<CustomActionRef Id="CustomAction1.PackageGuid"/>
<CustomActionRef Id="customaction2.PackageGuid"/>

To access this parameter value, I tried the following code in my customaction "Functionname" :

var value = session.Property["CustomActionData"];

The "value" is Empty. I did some debugging and found that, i am getting the value from below code:

var value = session.Property["customaction2.PackageGuid"];

I have not seen any examples that access properties with packageGuids also. I am not sure why the first approach(using "CustomActionData") is not working for me. Can you guys let me know what i am missing?

Also, Is there any harm in using with packageGuids? If not, i am planning to continue this way. Please let me know if you need me to try any other st

0

There are 0 best solutions below