You probably know that Windows has that option where you can view the properties of a binary and it will display information about the author, the version number, the compan
Assuming windows PE binaries, the Version information is stored in the PE header, in the IMAGE_OPTIONAL_HEADER
section under the locations:
WORD MajorImageVersion
WORD MinorImageVersion
About which this documentation says:
A user-definable field. This allows you to have different versions of an EXE or DLL. You set these fields via the linker /VERSION switch. For example, "LINK /VERSION:2.0 myobj.obj"
This just showed up on CodeProject yesterday:
Simple Version Resource Tool for Windows
It is a command line tool, but it should be easily operated from a script.
Look for an AssemblyInfo.cs to your project.
But this it has to be filled out before compilation. But you can share one AssemblyInfo.cs between many binaries. And you are not bound to this exact filename - so you can split the information into more files ... one general file about the company, one about the product, one for the binary's version number.
/ Individual Information
[assembly: AssemblyTitle( "" )]
[assembly: AssemblyDescription( "" )]
// Version information
[assembly: AssemblyVersion( "1.0.*" )]
[assembly: AssemblyInformationalVersion( "1.0.0.0" )]
// General Information
[assembly: AssemblyConfiguration( "" )]
[assembly: AssemblyCompany( "" )]
[assembly: AssemblyProduct( "" )]
[assembly: AssemblyCopyright( "" )]
[assembly: AssemblyTrademark( "" )]
[assembly: AssemblyCulture( "" )]
[assembly: NeutralResourcesLanguage( "en" )]
It looks as though the best solution (for us at least) is to use an RC file.
1 VERSIONINFO
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904E4"
BEGIN
VALUE "File Version", "1.0.4"
VALUE "Build Number", "3452"
END
END
END
Which is compiled into a .res file
rc.exe /fo Results/version.res version.rc
Which is then linked in with the rest of the object files.