Fragments are atomic blocks of "code" that are either incorporated or
ignored based on other fragments referencing them (a lot like functions
being included or ignored by the c/c++ linker based on an already included
code segment).

You could either put this in an include file (like Yan suggests) or add some
additional code to this fragment and reference that code from another
fragment that requires .net or from your main segment, the one that contains
your Product or Module element. This would require adding something to your
fragment that has a *Ref element counterpart you could use to reference it.

-----Original Message-----
From: Nick Ball [mailto:nick.b...@grantadesign.com] 
Sent: Friday, August 14, 2009 3:26 AM
To: wix-users@lists.sourceforge.net
Subject: [WiX-users] Prerequisites in a separate file

Hi All, 

 

I want to check for the presence of the .Net framework, so I've followed
the instructions in the WiX help and added the code successfully to the
project. It works fine. 

 

However, to simplify my project slightly, I thought I'd take this code
and put it in a file of its own and include that in my project (as
below). But this does not work - it fails to run the check. Of course,
it is no big deal to put it back, but in an attempt to gain a deeper
understanding of WiX, my question is simply: Why? 

 

-N

 

<?xml version="1.0" encoding="UTF-8"?>

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi";
xmlns:netfx="http://schemas.microsoft.com/wix/NetFxExtension";>

  <Fragment>

    <!-- Prerequisites - .Net -->

    <PropertyRef Id="NETFRAMEWORK30"/>

    <Condition Message="This application requires .NET Framework 3.0.
Please install the .NET Framework then run this installer again.">

      <![CDATA[Installed OR NETFRAMEWORK30]]>

    </Condition>

      </Fragment>

</Wix>

----------------------------------------------------------------------------
--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus
on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to