简体   繁体   English

如何在.wixproj中运行MSBuild脚本?

[英]How To Run MSBuild scripts in .wixproj?

Im trying to learn to make a web installer using Windows Installer XML (WIX 3.5). 我试图学习使用Windows Installer XML(WIX 3.5)制作Web安装程序。 I found this blog about using msbuild in .wixproj files to avoid the scenario where the installer ends up dropping the web project assemblies right in the root of the app instead of keeping them in the bin folder like they're supposed to be. 我找到了这个博客,内容涉及在.wixproj文件中使用msbuild以避免安装程序最终将Web项目程序集直接放到应用程序的根目录中,而不是像应有的那样将它们保留在bin文件夹中的情况。

Here is the link to that: < http://www.paraesthesia.com/archive/2010/07/30/how-to-consume-msdeploy-staged-web-site-output-in-a.aspx > 这是指向该链接的链接:< http://www.paraesthesia.com/archive/2010/07/30/how-to-consume-msdeploy-staged-web-site-output-in-a.aspx >

But after adding the MSBuild scripts in the .wixproj file, I don't know what to do anymore. 但是在.wixproj文件中添加MSBuild脚本后,我不知道该怎么办了。 According to the instruction after adding the MSBuild script: 根据说明添加MSBuild脚本后:

"When that target runs, you'll see a .wxs file pop out in the .wixproj project folder. Add the generated .wxs to your .wixproj project so it knows to include it in the build." “当目标运行时,您将在.wixproj项目文件夹中看到一个.wxs文件。将生成的.wxs添加到您的.wixproj项目中,以便它知道将其包含在构建中。”

I really don7t know what this means. 我真的不知道这意味着什么。 How can I run the target? 如何运行目标? I tried to build it but there was no .wxs file generated in the .wixproj folder. 我尝试构建它,但是.wixproj文件夹中没有生成.wxs文件。

Am I missing something? 我想念什么吗? Please help... 请帮忙...

Assuming you have added the section from the tutorial: 假设您已添加本教程中的部分:

<Target Name="BeforeBuild">
...
</Target>

The target will be run automatically when you build the project. 构建项目时,目标将自动运行。 The "BeforeBuild" target is one of the standard entry-points to add your own modifications to the build. “ BeforeBuild”目标是向构建添加您自己的修改的标准入口点之一。 The target will then generate a file (named [WebProjectName].wxs that is placed in the same directory as your wixproj file. Click on the show all files button in visual studio and right-click on the file and "Include in project" That will then include the wxs is your installer and when you next build it will have the correct folder/file structure. 然后目标将生成一个文件(名为[WebProjectName] .wxs,该文件与wixproj文件位于同一目录中。单击Visual Studio中的“显示所有文件”按钮,然后右键单击该文件,然后单击“包含在项目中”)。然后将包括wxs是您的安装程序,并且在您下次构建时,它将具有正确的文件夹/文件结构。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM