Wix

Description

Runs candle or light/lit from the Wix toolset - or both of them in sequence.

Parameters

Attribute Description Required
source The single source file to process. Either this or at least one nested <sources> set.
target The expected target file. Yes, unless you run candle without light.
mode Which part of the toolset to run, one of "candle", "light" or "both". No, default is "both".
vm Same as dotnetexec's vm attribute. Specify the framework to use. No.
wixHome Installation directory of WiX. No - Ant will assume WiX is on your PATH otherwise.
wixobjDestDir Directory that shall hold the .wixobj files generated by candle. No - Ant will candle have its way and use the current working directory if omitted.
useLit Whether to use lit.exe rather than light.exe. since .NET Antlib 1.1 No, default is "false".

Parameters specified as nested elements

sources

Specify source files that shall be passed on the command line. This is a fileset.

moresources

Specify source files that shall not be passed on the command line. This is a fileset.

Typically this would list include files when running candle or the files that become part of the MSI file when running light.

The files in this set are only used for timestamp comparisons. If neither these files nor the given "normal" sources are newer than the expected target, the task won't do anything.

candleParameter

Specifies preprocessor parameters for candle

candleParameter has two required attributes. name and value that specify name and value of a parameter.

candleArg

Specifies additional arguments for candle

candleArg is a command line argument.

lightParameter

Specifies parameters for light

lightParameter has two required attributes. name and value that specify name and value of a parameter.

lightArg

Specifies additional arguments for light

lightArg is a command line argument.

Examples

Create product.wixobj from product.wxs:

      <wix mode="candle" source="product.wxs"/>
    

The same but using a nested sources element:

      <wix mode="candle">
        <sources dir=".">
          <include name="product.wxs"/>
        </sources>
      </wix>
    

Create product.msi from product.wixobj:

      <wix mode="light" source="product.wixobj" target="product.msi"/>
    

Combine the examples into a single step:

      <wix source="product.wxs" target="product.msi"/>
    

Note that the task wouldn't do anything if product.wxs was older than product.wixobj and product.wixobj was older than product.msi.

Compile multiple .wxs files at once:

      <wix mode="candle">
        <sources dir=".">
          <include name="*.wxs"/>
        </sources>
      </wix>
    

Compile multiple .wxs files at once, specify some include files in addition to that:

      <wix mode="candle">
        <sources dir=".">
          <include name="*.wxs"/>
        </sources>
        <moresources dir=".">
          <include name="*.wxi"/>
        </moresources>
      </wix>
    

Link multiple .wixobj files at once:

      <wix mode="light" target="product.msi">
        <sources dir=".">
          <include name="*.wixobj"/>
        </sources>
      </wix>
    

Link multiple .wixobj files at once and specify that the files in directory "source" will become part of the package:

      <wix mode="light" target="product.msi">
        <sources dir=".">
          <include name="*.wixobj"/>
        </sources>
        <moresources dir="source"/>
      </wix>
    
Combine multiple .wxs files and include files
    into a single package and specify that the package will contain
    files from the source directory:
      <wix target="product.msi">
        <sources dir=".">
          <include name="*.wxs"/>
        </sources>
        <moresources dir=".">
          <include name="*.wxi"/>
        </moresources>
        <moresources dir="source"/>
      </wix>
    

Again, if the intermediate .wixobj files are newer that the corresponding .wxs files (and all include files) the candle step will be skipped. If product.msi is newer than all files, the task won't do anything.