pre-build event to change setup project's ProductVersion doesn't take effect until after the build

雨燕双飞 提交于 2019-12-24 02:14:59

问题


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).

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

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.

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


回答1:


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.

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.

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.



来源:https://stackoverflow.com/questions/9395279/pre-build-event-to-change-setup-projects-productversion-doesnt-take-effect-unt

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!