File content replacer - patching a .rc FileVersion and FILEVERSION

I'm trying to patch a Cpp visual studio project which renders a .exe file and I can't seem to figure out how to properly patch the file version property in the resource file.

TeamCity provides this tip in the section in the docs:

"In MFC *.rc files, both FileVersion and ProductVersion occur twice, once in a dot-separated (e.g. 1.2.3.4) and once in a comma-separated (e.g. 1,2,3,4) form. If your %build.number% parameter has a format of 1.2.3.{0}, using two build parameters with different delimiters instead of a single %build.number% is recommended."

 

And I am able to patch the dot-separated one without problems using %system.build.number%. Can anyone guide me when it comes to the "using two build paramters with different delimiters" tip? System.build.number currently consists of our branch name (which is a tag, typically x.x.x) with the build number appended, thus making it x.x.x.x. How can I create another one, say System.build.number.comma which is on the form x, x, x, x? Or is there a better solution?

 

Regards,

Yousif

0
1 comment

Hi Yousif,

There are several options, but definitely you are going to need two different parameters to pass the values. The probably most future proof option is to have them be combined of other values, such as for example, having:
system.build.number = %major%.%minor%.%bugfix%.%build.count%
and
system.build.number.comma = %major%,%minor%,%bugfix%,%build.count%

and then use both system.build.number and system.build.number.comma for the replacements.

That way, you can simply keep updating major, minor and bugfix as needed at the project level, and you don't need to change those variables at all.

0

Please sign in to leave a comment.