In your buildscript, create a file (version.info) that looks like this:
#define BINVERSION 1,2,3,4
#define STRVERSION "1.2.3.4"
You may need to create a small utility for this.
In your resource file you will have a resinfo version resource, the beginning will look like this:
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,2,3,4
PRODUCTVERSION 1,2,3,4
(...)
VALUE "FileVersion", "1.2.3.4"
VALUE "ProductVersion", "1.2.3.4"
Replace it like this:
VS_VERSION_INFO VERSIONINFO
FILEVERSION BINVERSION
PRODUCTVERSION BINVERSION
(...)
VALUE "FileVersion", STRVERSION
VALUE "ProductVersion", STRVERSION
#include "version.info"
, . ( .info).
Visual Studio (codeproject)