![]() |
Web Development »
Applications & Tools »
Tools with source code
Intermediate
Auto Windows Resource (*.rc) version EditorBy Réda BOUREBABAThis freeware allows to edit a Windows Resources File (*.rc) and to produce a file named 'version.h' containing several string constants (#define). It can also synchronize a RC file and version.h with the Classbuilder Master Header File. |
VC7Win2K, WinXP, MFC, Dev
|
|
Advanced Search Add to IE Search |
|
|
|
||||||||||||||||
This freeware is inspired by a tool by Srinivas Vaithianathan hosted by CodeProject too: Versioning of executables at build time. I completely modified it and now there isn't any code remaining from it.
Since several years now, I'm using a great open source tool named ClassBuilder. This tool is provided by Jimmy Venema and can be found at SourceForge.
From Sourceforge project page:
ClassBuilder is a freeware CASE tool targeted at the C++ developer, running on Win95/98/NT. It lets you create, manipulate and navigate classes, class relations, class members and class methods at a high level of abstraction through a graphical user interface.
ClassBuilder generates two files for each class (one *.cpp and one *.h) and a Master Header File for the whole data model. The Master Header File includes all the classes' headers, defines the typedefs,... This file also contains some symbolic constants which are automatically updated when you generate the sources. According to a data model named model, the Master Header File model.h will contain:
#define MODEL_DATE 20030211 #define MODEL_TIME 193311 #define MODEL_VERSION 12
Each time you change the interface, ClassBuilder increments MODEL_VERSION and updates MODEL_DATE and MODEL_TIME.
To use the data model, you should compile it as a static lib, an executable or a DLL. In case of exe or DLL, the Visual Studio generates a *.rc file. This file contains GUI definitions, icons, cursors, bitmaps... It should also contain the version information of the binary.
Here is the fragment of code in a Windows Resource File which describes the version information for RCVersion itself.
///////////////////////////////////////////////////////////////////////////// // // Version // VS_VERSION_INFO VERSIONINFO FILEVERSION 1, 0, 0, 100 PRODUCTVERSION 1, 0, 0, 1 FILEFLAGSMASK 0x3fL #ifdef _DEBUG FILEFLAGS 0x9L #else FILEFLAGS 0x8L #endif FILEOS 0x4L FILETYPE 0x1L FILESUBTYPE 0x0L BEGIN BLOCK "StringFileInfo" BEGIN BLOCK "040904b0" BEGIN VALUE "Comments", "Modified by BZCToOn's" VALUE "CompanyName", "Syntheretix" VALUE "FileDescription", "rcversion MFC Application" VALUE "FileVersion", "1, 0, 0, 100" VALUE "InternalName", "rcversion" VALUE "LegalCopyright", "Copyleft (C) Bzc ToOn'S 2002" VALUE "OriginalFilename", "rcversion.EXE" VALUE "PrivateBuild", "RCVERSION-20030212_100" VALUE "ProductName", "rcversion Application" VALUE "ProductVersion", "1, 0, 0, 1" END END BLOCK "VarFileInfo" BEGIN VALUE "Translation", 0x409, 1200 END END
RCVersion parses both the Master Header File and the Resources File. Next, according to the information contained in these two files, it generates a file named version.h and updates the Resources File.
Here is the output file produced by RCVersion for itself.
// Generated by RCVersion 1.0.0.1 build RCVERSION-20030212_100 (20030213-020245) // Copyleft (C) Bzc ToOn'S 2002 // Generated on 13/02/2003 02:02:46 from resource file rcversion.rc #define __SNAPSHOT__ "20030213-020246" #define __FILEVERSION__ "1.0.0.100" #define __PRODUCTVERSION__ "1.0.0.1" #define __COMPANY__ "Syntheretix" #define __PRODUCT__ "rcversion Application" #define __DESCRIPTION__ "rcversion MFC Application" #define __PRIVATEBUILD__ "RCVERSION-20030212_100" #define __COPYRIGHT__ "Copyleft (C) Bzc ToOn'S 2002" // Master Header Values (ClassBuilder)!! #define __CB_DATE__ "20030212" #define __CB_TIME__ "190244" #define __CB_VERSION__ "100" // Do Not Modify !!
rcversion [-q] [-i input]
-q quiet: don't show the UI. Usefull for Custom Build Step in Visual Studio.
-i input: specify the input file. The input file could be *.rc or *.h.
The filename without extension will be used as data model name.
#include 'version.h' in $(TargetName).h or in stdafx.h. Don't forget to put RCVERSION in path
or
To set Visual Studio executable path to the directory where RCVERSION is installed
I only tested RCVersion on my own projects. For me, it runs fine. I hope for you too ;-).
#ifdef _DEBUG / #endif
-p prefix to set the symbols prefix
RichEdit one to support fixed width font VERSIONINFO directive (FILEVERSION, PRODUCTVERSION), the whole line is replaced and the whole RC File is corrupted. | You must Sign In to use this message board. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
General
News
Question
Answer
Joke
Rant
Admin
|
PermaLink |
Privacy |
Terms of Use
Last Updated: 23 Jun 2003 Editor: Smitha Vijayan |
Copyright 2003 by Réda BOUREBABA Everything else Copyright © CodeProject, 1999-2009 Web18 | Advertise on the Code Project |