更改安装程序项目的ProductVersion的预构建事件要等到构建后才生效 [英] pre-build event to change setup project's ProductVersion doesn't take effect until after the build

查看:206
本文介绍了更改安装程序项目的ProductVersion的预构建事件要等到构建后才生效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已按照此处中所述的步骤进行操作使用prebuild事件在每个构建中修改我的安装项目上的ProductCode和ProductVersion.
(意思是-我创建了一个控制台应用程序,该应用程序使用上述代码来修改.vdproj文件,并从pre-build事件中触发它.)

I've followed the steps described here to modify the ProductCode and ProductVersion on my setup project on each build, using a prebuild event.
(meaning- I created a console application that uses the above-mentioned code to modify the .vdproj file, and I trigger it from the pre-build event).

该操作成功,完成构建后,我可以看到安装项目的'Version'属性已更改.

The operation is successful, and after the build is done I can see that the 'Version' property of the setup project has changed.

但是,编译的msi 的'ProductVersion'属性不会更改.
仅当我再次构建安装项目 时,才能看到'ProductVersion'发生了更改.

However, the 'ProductVersion' property of the compiled msi does not change.
Only if I build the setup project again, I can see that the 'ProductVersion' has changed.

在编译msi之后是否可能发生prebuild事件?

Is it possible that the prebuild event occurs after the msi is compiled?

推荐答案

我似乎回想起2005年前在VDPROJ上进行prebuild操作时遇到的问题,我们不得不创建带有构建依赖项的虚假C ++项目,以便可以使用postbuild of C ++在VDPROJ构建之前执行操作.

I seem to recall having problems with the prebuild action on VDPROJ back around 2005 and we had to create fake C++ projects with build dependencies so we could use the postbuild of the C++ to do things before the VDPROJ build.

出于记录目的,使用VDPROJ可能发生任何事情(失败).由于其缺点,该工具在下一版本的Visual Studio中已弃用.

For the record, anything is possible (to fail) with VDPROJ. The tool is deprecated in the next release of Visual Studio because of it's shortcomings.

在生成的MSI中对Property表的生成后SQL更新可能是一个更好的选择.当然,切换到其他工具将是更好的选择.

A postbuild SQL update of the Property table in the built MSI might be a better option. Switching to a different tool would certainly be a better option.

这篇关于更改安装程序项目的ProductVersion的预构建事件要等到构建后才生效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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