This is a mirror of official site: http://jasper-net.blogspot.com/

How to increment version information after each build in Visual C++

| Tuesday, March 1, 2011
You can write a program to modify the resource compiler (.rc) file instead of using the steps described here. However, the RC file is under the control of Visual C++. Visual C++ modifies the RC file while saving, and this may affect the version resource. The approach described in this section can be applied to any Visual C++ project. This example uses a Microsoft Foundation Classes project.

Create a new project using the MFC (EXE) Appwizard and call it MyProject. MyProject will have a MyProject.rc file, which includes MyProject.rc2. The .rc2 file is meant for user-defined resources. Follow these steps to increment MyProject's version information after each build:
Remove the version resource from the .rc file and place it in the .rc2 file:

Open both MyProject.rc and MyProject.rc2 (found in the Res folder), in a text editor. To use the Visual C++ editor, click Open on the File menu and select Text in the Open As list for the MyProject.rc file.
Find the version resource statements in MyProject.rc. It should look something like:

///////////////////////////////////////////////////////////////////////
//
// Version
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,1
PRODUCTVERSION 1,0,0,1
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
   BLOCK "StringFileInfo"
   BEGIN
       BLOCK "040904b0"
       BEGIN
           VALUE "Comments", "Sample Application\0"
           VALUE "CompanyName", "Microsoft Corp.\0"
           VALUE "FileDescription", "MyProject MFC Application\0"
           VALUE "FileVersion", "1, 0, 0, 1\0"
           VALUE "InternalName", "MyProject\0"

Cut the version resource from the MyProject.rc file and paste it into the MyProject.rc2 file below the comment "Add manually edited resources here." For information about what each one of the fields in the resource means, see the VERSIONINFO resource statement in Help.
Replace the FILEVERSION and PRODUCTVERSION data with macros FILEVER and PRODUCTVER. Similarly, replace the FileVersion and ProductVersion string data with the macros STRFILEVER and STRPRODUCTVER.
Add a #include VersionNo.h immediately before the VS_VERSION_INFO resource statement. Now the version resource will look like:


Read more: MS Support

Posted via email from Jasper-net

1 comments:

Anonymous said...

Thаt's where the aurawave and its exponent as a TENS pain in the neck backup can assist the physical structure to handout instinctive" painkillers" called endorphins, which helps the learning ability delivery approximately natural hurting alleviation has several advantages. Pain sensation interferes with our ability to springy a normal lifestyle, and since so, the securities industry, but the aurawave delivers.

my web blog ... Aurawave Review
My web site :: Daniel