Thread: Build number
View Single Post
Re: Build number
Old
  (#2)
botman
Super Moderator
 
Status: Offline
Posts: 280
Join Date: Jan 2004
Location: Plano, TX
Default Re: Build number - 30-07-2004

"I once made some program which increased some number in file, and was executed everytime i pressed build in MSVC. But i think there is a better way to do it."

I think that is the only way to have an automated build version number. Visual Studio doesn't have this as a built in feature.

You could make a batch file that creates a .h file with the version number in it, then include that .h file in your source code when building the executable. The problem with this is that MSVC will always want to rebuild the executable each time that .h file it changed (because the date of the .h file is more recent than the date of the .exe file since the custom build steps only run AFTER the .exe file has been generated). You will need to set the date of the .h file back to BEFORE the date of the .exe (or the .cpp files). You can create a little utility that generates this .h file and sets the modification date/time back to something in the past (before the .cpp and .exe files).

botman
  
Reply With Quote