如何为ASP.NET WebSites创建WIX安装?

时间:2011-11-29 17:17:44

标签: asp.net deployment installer wix web-site-project

我知道这个教程 http://wix.tramontana.co.hu/tutorial/getting-started/putting-it-to-use http://www.codeproject.com/KB/install/WixTutorial.aspx

...但我无法找到安装网站和配置IIS的快速解决方案。 是否有必要手动添加网站的每个文件?

1 个答案:

答案 0 :(得分:1)

您无需手动添加每个文件。相反,您可以使用Paraffin来收集Web项目所需的文件。

我将其配置为通过手动修改Wix项目文件以添加BeforeBuild操作,在构建期间(本地或服务器上)自动运行它。这是一个例子,您可以将此作为起点。

<Target Name="BeforeBuild">
    <!-- Set the WebClient.wxs file as not read-only -->
    <Exec Command="attrib -R &quot;$(ProjectDir)WebClient.wxs&quot;" />
    <!-- Run paraffin to generate the wix component for the web client. This assumes that web project has already been packaged. 
    This is automatically done on the build server by setting the property 'DeployOnBuild' to true. -->
    <Exec Command="paraffin -update WebClient.wxs -dir ..\RM.Web\obj\$(Platform)\$(Configuration)\Package\PackageTmp\" />
    <!-- Set the WebClient.wxs file back as read-only -->
    <Exec Command="attrib +R &quot;$(ProjectDir)WebClient.wxs&quot;" />
  </Target>