.exe文件名中的项目版本 [英] project version in .exe-filename
问题描述
我刚刚测试了自动版本插件,并且想知道是否可以将项目的版本放入输出exe的文件名中.
I just tested the auto-versioning plugin and was wondering whether it is possible to put the project's version into the output exe's filename.
例如输出看起来像这样:
So e.g. the output could look like this:
myProject_0.11.8.exe
能够在文件名中包含编译日期也很不错:
Being able to have the compile-time-date in the filename would be nice aswell:
myProject_2013_12_16.exe
有可能吗?
推荐答案
您可以将以下内容添加到输出文件名变量中:
You can add the following to the output filename variable:
添加$(TODAY)
或$(NOW_)
或$(NOW_L)
,将其放在文件名的末尾和.exe
部分之间,您将添加编译日期和时间(包括秒).
add $(TODAY)
or $(NOW_)
or $(NOW_L)
, placing it between the end of the filename and the .exe
part and you will add the compile date and time (including seconds).
要添加版本号,您需要执行一些步骤(可能有一种更简单的方法,但是我不知道并且很想听听它:)
To add the version number you need a few steps (there may be an easier way however I don't know one and would love to hear it:)
首先转到Global Compiler Settings >> #defines
,然后添加#version = RC_VERSION
:
First go to Global Compiler Settings >> #defines
and add #version = RC_VERSION
thusly:
然后在您的项目选项中转到:
Then in your project options go to:
我今天使用的是版本号,这意味着您每天和每个版本只获得一个exe,而使用NOW
则每分钟差异一个exe,而NOW_L
则每秒差异一个exe.
I use today and the version number as that means you only get one exe per day and version, whereas using NOW
gives an exe per minute difference and NOW_L
gives an exe per second of difference.
我已经在我的网站
I have uploaded a sample project at Test Project on my website http://www.dark-arts.tk (work in progress).
注意事项:请记住要为每个要以此格式设置的版本执行此操作!
NB: remember to do this for each build you want formatted this way!
希望这会有所帮助,如果您需要更多信息,请告诉我:)
Hope this helps, and let me know if you need more info:)
这篇关于.exe文件名中的项目版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!