问题描述
我有一个Delphi XE项目,我试图在使用MSBuild构建该程序之前更改该程序的版本号.版本号信息位于DPROJ文件中,但是如果我更改这些值,则版本号不会更改.我认为这样做的原因是,当您在IDE中更改版本号时,Delphi会将更改保存到DPROJ和RES文件中.
I have a Delphi XE project and I'm trying to change the version number of the program before building it with MSBuild. Version number information is located in the DPROJ file but if I change these values the version number does not change. I think the reason for this is that when you change version number in the IDE, Delphi saves the changes to both DPROJ and RES files.
是否可以通过DPROJ文件中的更改从命令行编译RES文件?我发现了这个问题,建议保存版本号在INC文件中并将其包含到项目中,但是与仅在DPROJ中进行更改相比,这感觉要复杂一些.
Is there a way to compile the RES file from the command line with the changes in DPROJ file? I found this question which suggested saving the version number in an INC file and including that to the project but this feels a bit more complex solution compared to just making changes in DPROJ.
推荐答案
我最终通过.首先,我在项目选项"中取消选中在项目中包括版本信息",并添加了带有假数据的VersionInformation.rc.当执行我的构建批处理文件时,它将生成正确的RC文件,并且由于该RC文件已添加到Delphi项目中,因此MSBuild使用所包含的信息来构建可执行文件.
I ended up solving my problem with this answer. First I unchecked "Include version information in project" in Project Options and added VersionInformation.rc with dummy data. When my build batch file is executed, it generates the correct RC file and because that RC file is added in to the Delphi project, MSBuild uses the contained information for built executable.
这篇关于从命令行增加Delphi XE项目版本号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!