2014-01-29 Marek Mielcarek <mmielca...@actuate.com>:
> Please take a look at this pseudo-code that represents my WiX xml:
>
> <Feature Id="Feature1">
> <ComponentGroupRef Id="CG1"/>
> </Feature>
> <Feature Id="Feature2">
>   <ComponentGroupRef Id="CG2"/>
> </Feature>
> ...
> <Fragment Id="F1">
>     <ComponentGroup Id="CG1"/>
>     <InstallExecuteSequence>
>       <Custom Action="CA1 " Before="InstallFinalize"><![CDATA[NOT 
> Installed]]></Custom>
>     <InstallExecuteSequence>
> </Fragment>
>
> <Fragment Id="FG1">
>     <ComponentGroup Id="CG2"/>
>     <InstallExecuteSequence>
>       <Custom Action="CA2 " Before="InstallFinalize"><![CDATA[NOT 
> Installed]]></Custom>
>     <InstallExecuteSequence>
> </Fragment>
>
> My intention was to run/schedule CA1 only for Feature1 and CA2 for Feature2 
> respectively. To my surprise, when the installer runs with only one feature 
> enabled (ADDLOCAL=Feature1) both Custom Actions (CA1 and CA2) are being 
> scheduled/executed anyway. I can obviously mitigate that by adding extra 
> condition, such as (&Feature1=3) for CA1 and (&Feature2=3) for CA2 but it 
> just does not seem to be OK.
> Since CA1 is in the group/fragment that is referred by Feature1 only, I'd 
> expect it to be activated when Feature1 installs.
> Can someone p[lease enlighten me why this it not working in such a way ?

Fragments don't even exist in the MSI, they are only a WiX thing. The
way you're using fragments makes the CA1 custom action be included in
the MSI or not, depending on whether you refer to CG1 from another
fragment or not (eg. from a Feature). Once the CA is included in the
MSI, it won't be affected by the installation state of features or
anything like that.

I'm pretty sure you need the extra conditions to do what you want (but
I don't know exactly how to do it).

-- 
Nicolás

------------------------------------------------------------------------------
WatchGuard Dimension instantly turns raw network data into actionable 
security intelligence. It gives you real-time visual feedback on key
security issues and trends.  Skip the complicated setup - simply import
a virtual appliance and go from zero to informed in seconds.
http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to