Using custom action session property in component condition #7879
Unanswered
kalyani1217
asked this question in
Questions
Replies: 1 comment
-
I expect your custom action is scheduled too late. A verbose log file should show you more detail. But you don't need a custom action to access environment variables. The Windows Installer documentation shows you can use |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
Would like to install the conditional component based on the property value which I'm setting in custom action.
What I have tried:
1)
Setting session property using
session[$"MyProperty"]="somevalue"
.This statement updating the session value. So, I've used 'MyProperty' for a component condition .
<Component Id="mycomp" Guid=""> <File Id="fileid" Source="content\igrans.ttf" TrueType="yes" /> <Condition><![CDATA[MyProperty = "somevalue"]]></Condition> </Component>
My custom action is:
<InstallExecuteSequence> <Custom Action="mycA" Before="InstallFiles">NOT Installed</Custom> </InstallExecuteSequence>
When I try to install the setup, the file is not installing. The condition always fails.
2)
I'm setting environment variable in custom action and using the environment variable in component condition. System environment variable is updating properly. But component is not installing.
custom action:
<InstallExecuteSequence > <Custom Action="mycA" Before="MigrateFeatureStates" >NOT Installed</Custom> </InstallExecuteSequence>
Component:
<Component Id="mycomp" Guid=""> <File Id="fileid" Source="content\igrans.ttf" TrueType="yes" /> <Condition><![CDATA[%EnvVar = "somevalue"]]></Condition> </Component>
Can someone please suggest how to add component condition correctly based on setting the property or environment variable in custom action?
Beta Was this translation helpful? Give feedback.
All reactions