Click here to Skip to main content
11,417,390 members (53,576 online)
Click here to Skip to main content

Versioning of executables at build time

, 19 Jun 2002
Rate this:
Please Sign up or sign in to vote.
A useful tool to incorporate version info during build time

Sample Image - rcversion.gif

Introduction

While building a project, it is sometimes necessary to include the version information. It would be great if this can be implemented as a step in the build process. Here I have provided a tool to prompt the user when a build is done for all the relevant version information and then write this to the project's resource file.

Steps to do

The application is dialog based MFC application. On inputting the value for the projects resource file, the version info is read and displayed. One can modify these values and write it back to the resource file. To include this in your build process in MSDEV, perform the following steps

  • Go to the project settings
  • Choose all configurations
  • Select your resource file
  • Check on Always use custom build step in the General tab.
  • In the Custom build tab enter this in the command field. (without the line break)
  • $(ProjDir)\{your tools directory}\rcversion.exe $(InputPath) rc /l 
    0x409 /fo"$(OutDir)/$(InputName).res" /d "_DEBUG" /d "_AFXDLL" $(InputPath) 

    where {your tools directory} is where you have copied the rcversion.exe

The source code is self-explanatory. Basically, the resource file is read, parsed for the version info and replaced with the new values. One can also pass in command line parameter for the input resource file name in case you would want to use this tool in a standalone way. Because there is dependency in the project to the resource.res, the tool is run only once during fresh build( or rebuild all).

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

Share

About the Author

srinivas vaithianathan
Web Developer
United States United States
No Biography provided

Comments and Discussions

 
QuestionIt doesn't work in VC++ 6 Pin
bschorre31-Aug-05 0:30
memberbschorre31-Aug-05 0:30 
AnswerRe: It doesn't work in VC++ 6 Pin
Anonymous31-Aug-05 8:49
sussAnonymous31-Aug-05 8:49 
GeneralInvoking exe files in c++ Pin
l_v_k22-Jan-04 20:44
memberl_v_k22-Jan-04 20:44 
General>256 characters bug. Pin
MattDodd1-Aug-03 3:48
memberMattDodd1-Aug-03 3:48 
Generaluh-oh Pin
dog_spawn1-Aug-03 4:49
memberdog_spawn1-Aug-03 4:49 
GeneralRe: uh-oh Pin
MattDodd1-Aug-03 5:20
memberMattDodd1-Aug-03 5:20 
GeneralNice Pin
Bugra Barin27-Feb-03 20:21
memberBugra Barin27-Feb-03 20:21 
GeneralVisual Sourcesafe Pin
Arnt Witteveen25-Jun-02 8:08
memberArnt Witteveen25-Jun-02 8:08 
GeneralRe: Visual Sourcesafe Pin
srinivas vaithianathan25-Jun-02 8:23
membersrinivas vaithianathan25-Jun-02 8:23 
GeneralCrash! Pin
Mel24-Jun-02 0:14
memberMel24-Jun-02 0:14 
GeneralRe: Crash! Pin
srinivas vaithianathan24-Jun-02 8:31
membersrinivas vaithianathan24-Jun-02 8:31 
GeneralRe: Crash! Pin
Mel24-Jun-02 9:55
memberMel24-Jun-02 9:55 
GeneralRe: Crash! Pin
Arnt Witteveen25-Jun-02 8:11
memberArnt Witteveen25-Jun-02 8:11 
QuestionAuto-increment Build Number ? Pin
Anonymous20-Jun-02 9:40
memberAnonymous20-Jun-02 9:40 
AnswerRe: Auto-increment Build Number ? Pin
srinivas vaithianathan24-Jun-02 8:34
membersrinivas vaithianathan24-Jun-02 8:34 
AnswerRe: Auto-increment Build Number ? Pin
Scott McKenzie25-Jun-02 16:03
memberScott McKenzie25-Jun-02 16:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.150427.4 | Last Updated 20 Jun 2002
Article Copyright 2002 by srinivas vaithianathan
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid