简体   繁体   English

更改安装程序项目的ProductVersion的预构建事件直到构建后才生效

[英]pre-build event to change setup project's ProductVersion doesn't take effect until after the 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. 我已按照此处介绍的步骤使用prebuild事件在每个构建中的安装项目上修改ProductCode和ProductVersion。
(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). (意思是-我创建了一个控制台应用程序,该应用程序使用上述代码来修改.vdproj文件,并从pre-build事件中触发它)。

The operation is successful, and after the build is done I can see that the 'Version' property of the setup project has changed. 操作成功,完成构建后,我可以看到安装项目的'Version'属性已更改。

However, the 'ProductVersion' property of the compiled msi does not change. 但是,已编译的msi的'ProductVersion'属性不会更改。
Only if I build the setup project again , I can see that the 'ProductVersion' has changed. 仅当我再次构建安装项目 ,才能看到“ ProductVersion”已更改。

Is it possible that the prebuild event occurs after the msi is compiled? 在编译MSI之后是否可能发生prebuild事件?

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. 我似乎回想起2005年前在VDPROJ上进行prebuild操作时遇到的问题,我们不得不创建带有构建依赖项的虚假C ++项目,因此我们可以使用C ++的postbuild在VDPROJ构建之前执行操作。

For the record, anything is possible (to fail) with VDPROJ. 记录下来,VDPROJ可能发生任何事情(失败)。 The tool is deprecated in the next release of Visual Studio because of it's shortcomings. 由于其缺点,该工具在下一版Visual Studio中已弃用。

A postbuild SQL update of the Property table in the built MSI might be a better option. 生成的MSI中的属性表的生成后SQL更新可能是一个更好的选择。 Switching to a different tool would certainly be a better option. 切换到其他工具肯定是更好的选择。

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

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