一步帮助构建所有项目+安装程序(.NET + WiX) [英] Help with one step build all projects + installer (.NET + WiX)

查看:89
本文介绍了一步帮助构建所有项目+安装程序(.NET + WiX)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在安装程序上有预构建事件,可以使用适当的配置等重建项目.

I have prebuild events on the installer to rebuild the projects with the appropriate configuration etc.

如果我在Visual Studio中的WiX(3.0)项目上右键单击构建/重建",则一切都可以正常构建,但是如果我尝试在wixproj文件上运行MSBuild,则构建前事件将引发错误.

If I right-click build/rebuild on the WiX (3.0) project in visual studio it all builds fine, but if I try to run MSBuild on the wixproj file the pre-build events will throw errors.

我可以改为在wixproj上调用Candle and Light,但它不会运行预构建事件.

I can instead call Candle and Light on the wixproj but it won't run the pre-build events.

prebuild事件依赖于VS提供的宏,除了创建另一个项目之外,我不确定如何解决该问题,基本上只使用尖叫尖叫的项目的prebuild事件.

The prebuild events rely on the macros provided by VS and I'm not sure how to get around that other than creating another project and basically just use the prebuild event of the project which just screams hack.

另一个问题是,我需要从命令行向WiX输入自更新版本号.

Another problem is that I need to feed in a self-updating version number into WiX from the command line.

我打算只使用一个csproj来处理版本号并对其进行更新,并且仅将其封装到MSBuild和Candle and Light中,但是问题是我不知道如何通过除代码之外的其他代码访问解决方案目录对其进行硬编码

I was planning on using just a csproj to handle the version number and updating it and just shelling to the MSBuild and Candle and Light, but the problem is that I don't know how to access the solution directory from code other than hard-coding it in

推荐答案

我们发现最简单的方法是使用实​​用工具来编辑项目本身,并转储所有预构建和后构建事件,然后再使用自动构建器进行构建(在我们的例子中 VisualBuild ).

We found it easiest to use a utility to edit the project itself and to dump all the pre-build and post build events before we build it with our autobuilder (in our case VisualBuild).

这为我们提供了一个很好而又多汁的构建过程,该过程不依赖于IDE中的任何讨厌的黑客,并且使我们可以完全控制源代码的来源和构建组件的去向.

This leaves us with a nice and juicy build process that doesn't rely on any nasty hacks in the IDE and give us full control over where source comes from and where built components go to.

这篇关于一步帮助构建所有项目+安装程序(.NET + WiX)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆