NAnt Configuration

Windows Installer XML

NAnt Configuration

Microsoft .NET Framework 4.0 Support

In order to build WiX using NAnt with only Microsoft Visual Studio 2010 and the .NET Framework 4.0, you need to add the following to the list of frameworks supported by NAnt.

<framework name="net-4.0" family="net" version="4.0" description="Microsoft .NET Framework 4.0" sdkdirectory="${path::combine(sdkInstallRoot, 'bin')}" frameworkdirectory="${installRoot}" frameworkassemblydirectory="${installRoot}" clrversion="4.0">
  <!-- ${installVersion} -->
  <runtime>
    <probing-paths>
      <directory name="lib/net/4.0" />
      <directory name="lib/net/neutral" />
      <directory name="lib/common/4.0" />
      <directory name="lib/common/neutral" />
    </probing-paths>
    <modes>
      <strict>
        <environment>
          <variable name="COMPLUS_VERSION" value="v${installVersion}" />
        </environment>
      </strict>
    </modes>
  </runtime>
  <reference-assemblies basedir="${path::combine(installRoot, 'v' + ${installVersion})}">
    <include name="Accessibility.dll" />
    <include name="mscorlib.dll" />
    <include name="Microsoft.Build.Utilities.dll" />
    <include name="Microsoft.Vsa.dll" />
    <include name="Microsoft.VisualBasic.dll" />
    <include name="Microsoft.VisualBasic.Compatibility.dll" />
    <include name="Microsoft.VisualBasic.Compatibility.Data.dll" />
    <include name="System.Configuration.dll" />
    <include name="System.Configuration.Install.dll" />
    <include name="System.Data.dll" />
    <include name="System.Data.OracleClient.dll" />
    <include name="System.Data.SqlXml.dll" />
    <include name="System.Deployment.dll" />
    <include name="System.Design.dll" />
    <include name="System.DirectoryServices.dll" />
    <include name="System.dll" />
    <include name="System.Drawing.Design.dll" />
    <include name="System.Drawing.dll" />
    <include name="System.EnterpriseServices.dll" />
    <include name="System.Management.dll" />
    <include name="System.Messaging.dll" />
    <include name="System.Runtime.Remoting.dll" />
    <include name="System.Runtime.Serialization.Formatters.Soap.dll" />
    <include name="System.Security.dll" />
    <include name="System.ServiceProcess.dll" />
    <include name="System.Transactions.dll" />
    <include name="System.Web.dll" />
    <include name="System.Web.Mobile.dll" />
    <include name="System.Web.RegularExpressions.dll" />
    <include name="System.Web.Services.dll" />
    <include name="System.Windows.Forms.dll" />
    <include name="System.Xml.dll" />
    <include name="Microsoft.Build.Engine.dll" />
    <include name="Microsoft.Build.Framework.dll" />
    <include name="System.AddIn.Contract.dll" />
    <include name="System.AddIn.dll" />
    <include name="System.Core.dll" />
    <include name="System.Data.DataSetExtensions.dll" />
    <include name="System.Data.Linq.dll" />
    <include name="System.DirectoryServices.AccountManagement.dll" />
    <include name="System.Management.Instrumentation.dll" />
    <include name="System.Net.dll" />
    <include name="System.ServiceModel.Web.dll" />
    <include name="System.Web.Extensions.Design.dll" />
    <include name="System.Web.Extensions.dll" />
    <include name="System.Windows.Presentation.dll" />
    <include name="System.WorkflowServices.dll" />
    <include name="System.Xml.Linq.dll" />
    <include name="System.IdentityModel.dll" />
    <include name="System.IdentityModel.Selectors.dll" />
    <include name="System.IO.Log.dll" />
    <include name="System.Printing.dll" />
    <include name="System.Runtime.Serialization.dll" />
    <include name="System.ServiceModel.dll" />
    <include name="System.Speech.dll" />
    <include name="System.Workflow.Activities.dll" />
    <include name="System.Workflow.ComponentModel.dll" />
    <include name="System.Workflow.Runtime.dll" />
    <include name="WindowsBase.dll" />
  </reference-assemblies>
  <task-assemblies>
    <!-- include MS.NET version-neutral assemblies -->
    <include name="extensions/net/neutral/**/*.dll" />
    <!-- include MS.NET 4.0 specific assemblies -->
    <include name="extensions/net/4.0/**/*.dll" />
    <!-- include MS.NET specific task assembly -->
    <include name="NAnt.MSNetTasks.dll" />
    <!-- include MS.NET specific test assembly -->
    <include name="NAnt.MSNet.Tests.dll" />
    <!-- include .NET 4.0 specific assemblies -->
    <include name="extensions/common/4.0/**/*.dll" />
  </task-assemblies>
  <tool-paths>
    <directory name="${path::combine(sdkInstallRoot, 'bin')}" if="${property::exists('sdkInstallRoot')}" />
    <directory name="${installRoot}" />
  </tool-paths>
  <project>
    <readregistry property="installRoot" key="SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Client\InstallPath" hive="LocalMachine" />
    <readregistry property="installVersion" key="SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Client\Version" hive="LocalMachine" />
    <readregistry property="sdkInstallRoot" key="SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0\WinSDK\InstallationFolder" hive="LocalMachine" failonerror="false" />
    <readregistry property="sdkInstallRoot" unless="${property::exists('sdkInstallRoot')}" key="SOFTWARE\Microsoft\Microsoft SDKs\Windows\v7.0A\InstallationFolder" hive="LocalMachine" failonerror="false" />
  </project>
  <tasks>
    <task name="csc">
      <attribute name="supportsnowarnlist">true</attribute>
      <attribute name="supportswarnaserrorlist">true</attribute>
      <attribute name="supportskeycontainer">true</attribute>
      <attribute name="supportskeyfile">true</attribute>
      <attribute name="supportsdelaysign">true</attribute>
      <attribute name="supportsplatform">true</attribute>
      <attribute name="supportslangversion">true</attribute>
    </task>
    <task name="vbc">
      <attribute name="supportsdocgeneration">true</attribute>
      <attribute name="supportsnostdlib">true</attribute>
      <attribute name="supportsnowarnlist">true</attribute>
      <attribute name="supportskeycontainer">true</attribute>
      <attribute name="supportskeyfile">true</attribute>
      <attribute name="supportsdelaysign">true</attribute>
      <attribute name="supportsplatform">true</attribute>
      <attribute name="supportswarnaserrorlist">true</attribute>
    </task>
    <task name="jsc">
      <attribute name="supportsplatform">true</attribute>
    </task>
    <task name="vjc">
      <attribute name="supportsnowarnlist">true</attribute>
      <attribute name="supportskeycontainer">true</attribute>
      <attribute name="supportskeyfile">true</attribute>
      <attribute name="supportsdelaysign">true</attribute>
    </task>
    <task name="resgen">
      <attribute name="supportsassemblyreferences">true</attribute>
      <attribute name="supportsexternalfilereferences">true</attribute>
    </task>
    <task name="delay-sign">
      <attribute name="exename">sn</attribute>
    </task>
    <task name="license">
      <attribute name="exename">lc</attribute>
      <attribute name="supportsassemblyreferences">true</attribute>
    </task>
  </tasks>
</framework>