我正在尝试使用MSBuild/Delphi 2010编译EXE,我尝试过:
I'm trying to compile an EXE using MSBuild / Delphi 2010, I tried this:
MSBuild.exe/t:Clean; Build/p:config = Release; ExtraDefines ="CodeTest"/property:FileVersion=1.0.0.15"D:\ MyProject \ MyFile.dproj"
MSBuild.exe /t:Clean;Build /p:config=Release;ExtraDefines="CodeTest" /property:FileVersion=1.0.0.15 "D:\MyProject\MyFile.dproj"
已构建文件,但未设置版本
File is built but version isn't set
到底怎么了?
推荐答案您的属性"FileVersion"在MSBuild会话中可用,但是除非您有一个以某种方式使用它的Task或Target,否则它不会用于任何用途.您将需要(如DHeffernan所说)创建代码使用的版本资源,或使用后编译工具将版本信息应用于您的exe或dll.
Your property "FileVersion" is available inside the MSBuild session, but unless you have a Task or Target that uses it somehow, it's not being used for anything. You'll either need to (as DHeffernan says) create a version resource that your code uses or use a post-compile tool to apply the version info to your exe or dll.
这篇 StackOverflow文章列出了许多用于进行后编译的工具.
This StackOverflow article lists a number of tools to do the post-compile thing.
更多推荐
使用MSBuild构建EXE时如何指定文件版本?
发布评论