Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to include fragments in Wix?

Tags:

wix

wix3.5

I have created a wixlib to share fragments in some wix projects.
I can reference fragments which have Property in my main wix file with a PropertyRef, but how can I reference fragments where I want a bulk copy of its content??
For example I have a fragment which tests if .net framework is installed and I want to include that fragment in my main wix file in the project tag...
Here's the fragment located in my wixlib that I want to include in several wix project:

  <Fragment Id="fm35">
    <PropertyRef Id="NETFRAMEWORK35" />
    <Condition Message="framework 3.5 is not installed">
      <![CDATA[Installed OR NETFRAMEWORK35]]>
    </Condition>
  </Fragment>

Thanks!!

like image 600
Steph Ragazzi Avatar asked Nov 02 '11 09:11

Steph Ragazzi


1 Answers

Back in the old days of wix 2 we used to have FragmentRef elements. It was very easy to include any fragment in your Product section and it was very easy for anyone reading the xml to figure out what was being done.

<FragmentRef Id="CustomActionFrag" />
<FragmentRef Id="PropertiesFrag" />

Now in wix 3 they have eliminated the FragmentRef element. Not sure why. I find it very anoying, because in my Product element I have to add several references to "something defined in my fragments"

<CustomActionRef Id="caDoSomething"/>
<PropertyRef Id="PropCryptic"/>

If I don't do that the fragment is completely ignored and does not make its way into the final MSI.

That's very cryptic for anyone reading the xml. Give my FragmentRef's back!

like image 123
Alex Avatar answered Sep 24 '22 12:09

Alex