Vivek
Posts: 1
Joined: Tue Nov 21, 2023 8:34 am

How pass the property value from CA to wix file

Hi,

Would like to incorporate the conditional component installation based on a property value set in a custom action. Here's what I've attempted:
If the condition is True, Install the file else skip the installation on the particular file.

Set the session property using the statement: session[$"MyProperty"]="somevalue". This successfully updates the session value. I then utilized 'MyProperty' for a component condition:

Code: Select all

<Component Id="mycomp" Guid="">
  <File Id="fileid" Source="SomeRandomFile" />
  <Condition><![CDATA[MyProperty = "somevalue"]]></Condition>
</Component>
My custom action is defined as follows:

Code: Select all

<Binary Id="BID" SourceFile="path.CA.dll" />
<CustomAction Id="MYCA" BinaryKey="BID" DllEntry="MYCA" Execute="immediate" Return="check" />

Code: Select all

<InstallExecuteSequence>
  <Custom Action="MYCA" Before="InstallFiles">NOT Installed</Custom>
</InstallExecuteSequence>
However, during the setup installation, the file does not install, and the condition consistently fails.
I'm uncertain about what might be causing the issue. Can someone provide guidance on how to achieve the desired outcome?
Catalin
Posts: 6608
Joined: Wed Jun 13, 2018 7:49 am

Re: How pass the property value from CA to wix file

Hello and welcome to Advanced Installer forums,

I'm afraid I'm not sure how this ticket is related to Advanced Installer - please note this forum is for technical support regarding Advanced Installer.

If possible, could you please provide some more details so I can better assist?

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”