0

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

Sathish M
  • 51
  • 1
  • Didn't read too closely, but [please see if this answer has any clues](https://stackoverflow.com/a/54298965/129130). – Stein Åsmul Jul 11 '19 at 13:23
  • Hi @stein , I checked the link you shared. In my case, I am able to read the CustomAction data. But, I could do this only by using the "packageGuid". I am not sure why. I wanted to understand if there are any side-effects of using this. – Sathish M Jul 15 '19 at 04:34

0 Answers0