Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>As iwo said, <a href="http://wix.sourceforge.net/manual-wix3/preprocessor.htm" rel="nofollow noreferrer">preprocessor variables</a> are your friend! However the example from iwo can (and will) violate component rules, as the component isn't 'stable'. Better to condition an entire component (or component group)...</p> <pre><code>&lt;?if $(var.releasetype)=full ?&gt; &lt;ComponentRef Id="Somefile.dll" /&gt; &lt;?elseif $(var.releasetype)=enterprise ?&gt; &lt;ComponentGroupRef Id="SomethingElse" /&gt; &lt;?endif?&gt; </code></pre> <p>And then include the <code>Component</code> and <code>ComponentGroup</code>s in separate <code>Fragment</code> tags so that they will only be compiled when referenced :)</p> <pre><code>&lt;Fragment&gt; &lt;Component Id="Somefile.dll" Guid="*"&gt; &lt;File Id="Somefile.dll" KeyPath="yes" Source="SourceDir\Somefile.dll" /&gt; &lt;/Component&gt; &lt;/Fragment&gt; &lt;Fragment&gt; &lt;ComponentGroup Id="SomethingElse"&gt; &lt;ComponentRef Id="Somefile.dll" /&gt; &lt;Component Id="AnotherFile.dll&gt; &lt;File Id="AnotherFile.dll" KeyPath="yes" Source="SourceDir\AnotherFile.dll" /&gt; &lt;/Component&gt; &lt;/ComponentGroup&gt; &lt;/Fragment&gt; </code></pre> <p>Personally I use <a href="http://nant.sourceforge.net/" rel="nofollow noreferrer">nant</a> to call <code>candle</code> and <code>light</code> targets, defining different variables for various different builds and products, effective use of fragments and preprocessor variables provides a great opportunity for code re-use between projects, or various releases of the same project.</p> <p>In your case, to check if a file exists... then you'd just use the internal functions to define, or redefine a variable that is later passed to WiX. e.g.:</p> <pre><code>&lt;if test="${not file::exists('something.dll')}"&gt; &lt;property name="releasetype" value="blahblahblah" /&gt; &lt;/if&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload