Click here to Skip to main content
13,351,225 members (49,842 online)
Click here to Skip to main content
Add your own
alternative version


24 bookmarked
Posted 29 Nov 2004

Increment File and Product Version Number

, 29 Nov 2004
Rate this:
Please Sign up or sign in to vote.
An add-in to automatically increment the FileVersion and ProductVersion fields in your application's resource file.


This add-in enhances the add-in provided by Mihai Filimon. Instead of incrementing the Private Build number every time a compilation is performed, the product and file version fields in the resource are incremented.

I wanted my code updates to be included as part of his original posting but I have not heard anything back from Mihai, so I am submitting a new article, allowing you to have access to the code and a pre-built DLL, so you don't have to waste your time contacting me.


To read the original article upon which this is based, please see Mihai Filimon's 'Increment Private Build Number' in the MFC / C++ >> Macros and Add-ins >> DevStudio Add-ins section.

Having read the various comments on the previous article, I felt compelled to improve Mihai's (already excellent) code.

I was not willing to put up with DevStudio message about the resource file needing to be reloaded, as pointed out by Brian Shifrin, and added support so that it will look in the rc2 file (in the res directory) first for the VERSIONINFO block(s). If it doesn't find the version stuff there, it looks in the rc file as normal. This allows you to move the VERSIONINFO stuff to the rc2 file to avoid the annoying pop-ups. But for those who can't be bothered, the increment will still work on the rc file. In fact, I would advise moving the entire VERSION_INFO block to the rc2 file to save yourself the heartache of being prompted to reload the resources every time you compile.

The biggest change though is as a result of the comment made by Laurence Zaysser who said that the PrivateBuild and SpecialBuild fields are meant for comment text. So instead, the increment takes place on the last digit of the FileVersion and ProductVersion fields. I have noticed some funny behavior if the numbers do not match for the file version and product version fields. The increment just does not seem to take place. But this should not be a problem if you have never edited the version number manually. If you have, just ensure that the numbers are all the same, and of course separated with commas.

Using the code

In the ZIP file, I have included a Release build of the DLL which can be put straight into the \Program Files\Microsoft Visual Studio\Common\MSDev98\AddIns\ directory. You should then be able to choose Tools->Options->Add-ins and Macros, from your Visual Studio menu, and select the IncVersion Developer Studio Add-in.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Jordan Walters
Software Developer (Senior)
United Kingdom United Kingdom
Ok, it's about time I updated this profile. I still live near 'Beastly' Eastleigh in Hampshire, England. However I have recently been granted a permamant migration visa to Australia - so if you're a potential employer from down under and like the look of me, please get in touch.
Still married - just, still with just a son and daughter. But they are now 8 and 7 resp and when together they have the energy of a nuclear bomb.
I worked at Teleca UK for over 8.5 years (but have now moved to TikitTFB) and have done loads of different things. Heavily involved with MFC, SQL, C#, The latest is ASP.NET with C# and Javascript. Moving away from Trolltech Qt3 and 4.

You may also be interested in...


Comments and Discussions

NewsUpdated add-in Pin
Jordan Walters18-Mar-08 14:21
memberJordan Walters18-Mar-08 14:21 
GeneralSource safe Pin
Marek Hrncir14-Mar-05 0:40
memberMarek Hrncir14-Mar-05 0:40 
GeneralRe: Source safe Pin
Jordan Walters14-Mar-05 0:49
memberJordan Walters14-Mar-05 0:49 
GeneralSource safe Pin
Marek Hrncir14-Mar-05 0:38
memberMarek Hrncir14-Mar-05 0:38 
QuestionAutomatic support? Pin
prcarp6-Dec-04 3:23
memberprcarp6-Dec-04 3:23 
AnswerRe: Automatic support? Pin
Jordan Walters14-Dec-05 11:49
memberJordan Walters14-Dec-05 11:49 
GeneralNothing happens.. Pin
John M. Drescher30-Nov-04 8:47
memberJohn M. Drescher30-Nov-04 8:47 
GeneralRe: Nothing happens.. Pin
Jordan Walters30-Nov-04 23:07
memberJordan Walters30-Nov-04 23:07 
GeneralRe: Nothing happens.. Pin
Budde871-Nov-05 7:19
memberBudde871-Nov-05 7:19 
GeneralRe: Nothing happens.. Pin
Jordan Walters14-Dec-05 11:52
memberJordan Walters14-Dec-05 11:52 

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

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

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.180111.1 | Last Updated 30 Nov 2004
Article Copyright 2004 by Jordan Walters
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid