Candle Task

Windows Installer XML (WiX) v3.0

Candle Task

The Candle task wraps candle.exe, the WiX compiler. It supports a variety of settings that are described in more detail below. The following is a sample shows a the NAnt code used to run the Candle task:

<candle
  exedir="${wix.dir}"
  out="${release.dir}\obj\\"
  rebuild="true"
  extensions="WixUIExtension;WixUtilExtension"
  warningsaserrors="true">
  <defines>
    <define name="ProjectDir" value="${release.dir}" />
    <define name="Configuration" value="Release" />
    <define name="Version" value="${buildnumber.version}" />
  </defines>
  <sources basedir="${releasemsi.dir}">
    <include name="Product.wxs" />
    <include name="Files.wxs" />
 </sources>
</candle>

The following table describes the common WiX NAnt parameters that are applicable to the Candle task.

Parameter Description
exedir Optional string parameter.

Sets the directory to the tool executable. Defaults to the path specified by the registry key "HKLM\SOFTWARE\Microsoft\Windows Installer XML\3.0\InstallRoot" which is set by the WiX installation.
If no path is found or specified the task assumes the executable is on the path.
out Required string parameter.

Sets the file or directory to write the output to. This is equivalent to the -out switch.
extensions Optional string parameter.

Semi-colon separated list of WiX extensions to load. This is equivalent to the -ext switch.
rebuild Optional boolean parameter.

Instructs NAnt to recompile the output file regardless of the file timestamps..
sources Required NAnt fileset.

The set of source files for compilation.
warningsaserrors Optional boolean parameter.

Specifies that certain warnings should be treated as errors. This is equivalent to the -wx switch.
verbose Optional boolean parameter.

Specifies that the tool should provide verbose output. This is equivalent to the -v switch.

The following table describes the parameters that are specific to the Candle task.

Parameter Description
defines Optional NAnt fileset.

This is equivalent to the -d<name>[=<value>] switch in candle.exe.
includedirs Optional NAnt fileset.

Specifies directories to add to the compiler include search path. This is equivalent to the -I<dir> switch in candle.exe.

Additional options can be added by using the standard NAnt <arg> elements, e.g.:

<arg line="-pedantic" />