使用MSBuild构建EXE时如何指定文件版本?

编程入门 行业动态 更新时间:2024-10-26 08:30:07
本文介绍了使用MSBuild构建EXE时如何指定文件版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我正在尝试使用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时如何指定文件版本?

本文发布于:2023-11-10 09:24:51,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1574993.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:版本   文件   MSBuild   EXE

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!