简体   繁体   English

有没有一种干净的方法来在构建时设置VS 2008安装项目的属性?

[英]Is there a clean way to set a VS 2008 setup project's properties at build time?

I have an Office add-in project with a setup project for deployment (using VS 2008), and I need to build the same product in a few different flavours. 我有一个Office加载项项目,其中包含一个用于部署的安装项目(使用VS 2008),并且需要以几种不同的方式构建同一产品。

I'm looking for a good way to make the installer resources dependent on the build configuration. 我正在寻找一种使安装程序资源依赖于构建配置的好方法。 The product name, manufacturer, manufacturer url, author, etc., etc. properties should be different for each of the builds. 每个构建的产品名称,制造商,制造商url,作者等等等属性都应不同。 Also, the images shown in the installer UI will be different as well. 同样,安装程序UI中显示的图像也将有所不同。

If possible, I'd like to do this without creating a new project for each different UI. 如果可能的话,我希望不为每个不同的UI创建新项目就这样做。 I believe this could be done using the ORCAS tool and build events, but this approach seems overly complex and fragile. 我相信可以使用ORCAS工具和构建事件来完成此操作,但是这种方法似乎过于复杂和脆弱。

Does anyone have any ideas on a clean way to go about doing this? 有没有人有任何清洁的想法可以做到这一点?

另一个选择,尽管它还有很多工作要做,但是将安装项目丢到窗口之外,而使用例如WiX( http://wix.sf.net

I think the best way is to create hand-made NAnt script. 我认为最好的方法是创建手工制作的NAnt脚本。

Explaination: 说明:

NAnt is a build tool that besides building can execute scripts. NAnt是一个构建工具,除了构建外还可以执行脚本。 By creating scripts and targets you can modify files that are checked out from your SCM, and then order them to build. 通过创建脚本和目标,您可以修改从SCM中检出的文件,然后命令它们进行构建。 Check out official NAnt site for more informations. 请访问NAnt官方网站以获取更多信息。

You could manually make copies of the vddproj file and edit them with a text editor. 您可以手动制作vddproj文件的副本,并使用文本编辑器进行编辑。 I admit, this is not a very robust solution and you would have to repeat this step every time the content of your setup changes. 我承认,这不是一个非常可靠的解决方案,每次安装内容更改时,您都必须重复此步骤。

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

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