Nant构建MSI文件

nik*_*kky 0 nant windows-installer

我如何使用NAnt来构建msi文件

谢谢

sas*_*ont 6

您可以使用随WiX提供的Nant任务,请参阅此博客文章并在WiX帮助文件(WiX.chm)中搜索"Nant"

以上博客文章的简单示例供您参考,我自己的实际.build文件超过500行,主要是相关的任务,如构建bootstrappers,提取源代码,代码签名,与Lingobit集成以进行本地化等等.构建实际的MSI可能是代码中最简单的部分:)

<target name="package" description="Create the installer package">

  <property name="wix.dir" value="${base.dir}\WiX" />
  <loadtasks assembly="${wix.dir}\Microsoft.Tools.WindowsInstallerXml.NAntTasks.dll" />

  <candle out="${nant.project.basedir}\" exedir="${wix.dir}">
    <sources>
      <include name="MyApp.wxs" />
    </sources>
  </candle>

  <light out="MyApp.msi" exedir="${wix.dir}"
    locfile="${wix.dir}\lib\WixUI_en-us.wxl" rebuild="true">
    <sources>
      <include name="MyApp.wixobj" />
      <include name="${wix.dir}\ca\wixca.wixlib" />
      <include name="${wix.dir}\lib\wixui_featuretree.wixlib"/>
    </sources>
  </light>

</target>
Run Code Online (Sandbox Code Playgroud)