It is currently Sun Apr 30, 2017 2:07 am

All times are UTC - 5 hours




 Page 1 of 1 [ 1 post ] 
Author Message
 Post subject: Build Number (external file)
PostPosted: Tue Nov 10, 2015 9:22 am 
Site Admin

Joined: Sun Feb 11, 2007 8:59 am
Posts: 1094
Location: Ontario Canada
Image Download BuildNumber.rar

Description of Program:
The BuildNumber application will automatically increment a value stored in an external BuildNumber.txt file every time that the application is run. You can then use the BuildConfig class to extract and current build number and build date and time to use in your programs.

Installation:
  • Download the BuildNumber.rar file using the link shown above
  • Extract the BuildNumber.exe file from the RAR and place it somewhere on your hard drive (ie. C:\_bin\)
  • Extract the BuildConfig.cpp and BuildConfig.h files from the RAR and add them to your C++ project
  • Add the following Post-Build Event to your Visual C++ project
C:/_bin/BuildNumber.exe "$(OutDir)"


How It Works:
After you add the BuildConfig class to your project, you can use the following static functions to retrieve info:
vmk::BuildConfig::getGameName();
vmk::BuildConfig::getVersion();   
vmk::BuildConfig::getBuildDate()


When you request the Version or Build Date, the class will attempt to open the BuildNumber.txt file to extract the latest data stored there. Once the data is extracted it will just return the values to you rather than opening the file each time a request is made.

At the top of the BuildConfig.cpp file you'll find the following variables:
static bool s_isInitialized = false;

static const std::string s_strBuildNumberFile( "BuildNumber.txt" );
static const std::string s_strGameName( "www.MarekKnows.com : Shader Engine" );
static int s_iMajorVersion = 1;
static int s_iMinorVersion = 0;
static int s_iBuildNumber = 0;
static std::string s_strVersion;
static std::string s_strBuildDate( "Unknown" );


You can set the game name and version values here. With the Post Build Event defined in your project, every time a new build is made, the BuildNumber.txt file will be updated.

For complete details on how to use this program, watch the Shader Engine VMK 109 - Build Number Update


Offline
 Profile  
 
Display posts from previous:  Sort by  
 Page 1 of 1 [ 1 post ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Jump to:  

cron