Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Automatically appending an auto incrementing build number to Apps title in Visual Studio 2009..? [modified]

Automatically appending an auto incrementing build number to Apps title in Visual Studio 2009..? [modified]

Scheduled Pinned Locked Moved C / C++ / MFC
c++csharpvisual-studiocomwindows-admin
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    montiee
    wrote on last edited by
    #1

    Does anyone have instructions on how I would go about automatically adding an auto-increment build number each time the app is compiled so that it shows up in the apps titlebar? For eg say I have an app called Browser. First time I compile my app the title would be Browser V1.0 (build 1). I compile it again and it would be Browser V1.0 (build 2) etc. I don't want to have to manually go into the dialog editor and change it for each compile and neither do I want to have to update a variable by hand each time for compile. Any help would be appreciated. The language is VC++ and I'm using Visual Studio 2009. Thanks! PS: I'd like something that doesn't require me to alter or add stuff to the registry. I want to be able to grab the project folder, copy it to another machine and have it work straight off the bat without going through registering 3rd party dll's in the registry each time I move the source code to another PC. I found http://www.codeproject.com/KB/cpp/autobuildnumber.aspx but don't like the fact I need to go through a setup procedure that goes outside of the compiler. Also most discussions about the topic date back 6+ years. I'm hoping MS added some functionality into VS2009 to maybe make the process simpler, more native.

    modified on Sunday, October 5, 2008 8:05 AM

    B 1 Reply Last reply
    0
    • M montiee

      Does anyone have instructions on how I would go about automatically adding an auto-increment build number each time the app is compiled so that it shows up in the apps titlebar? For eg say I have an app called Browser. First time I compile my app the title would be Browser V1.0 (build 1). I compile it again and it would be Browser V1.0 (build 2) etc. I don't want to have to manually go into the dialog editor and change it for each compile and neither do I want to have to update a variable by hand each time for compile. Any help would be appreciated. The language is VC++ and I'm using Visual Studio 2009. Thanks! PS: I'd like something that doesn't require me to alter or add stuff to the registry. I want to be able to grab the project folder, copy it to another machine and have it work straight off the bat without going through registering 3rd party dll's in the registry each time I move the source code to another PC. I found http://www.codeproject.com/KB/cpp/autobuildnumber.aspx but don't like the fact I need to go through a setup procedure that goes outside of the compiler. Also most discussions about the topic date back 6+ years. I'm hoping MS added some functionality into VS2009 to maybe make the process simpler, more native.

      modified on Sunday, October 5, 2008 8:05 AM

      B Offline
      B Offline
      Bram van Kampen
      wrote on last edited by
      #2

      What I use is the Build Date held in the PE Header. you get that by opening your exe or dll as a binary file for reading, and wade through the headers. These headers are declared in "Windows.h". I do this once in InitInstance(), and store the value in a global time_t. You can then choose in your AboutDlg to just show this as a 'Secret' number, or format it out as a Build Date and Time. Furthermore, this info is also immediately available to your install routines, and is available for all binaries, whether built by you with this in mind, or otherwise. regards :)

      Bram van Kampen

      M 1 Reply Last reply
      0
      • B Bram van Kampen

        What I use is the Build Date held in the PE Header. you get that by opening your exe or dll as a binary file for reading, and wade through the headers. These headers are declared in "Windows.h". I do this once in InitInstance(), and store the value in a global time_t. You can then choose in your AboutDlg to just show this as a 'Secret' number, or format it out as a Build Date and Time. Furthermore, this info is also immediately available to your install routines, and is available for all binaries, whether built by you with this in mind, or otherwise. regards :)

        Bram van Kampen

        M Offline
        M Offline
        montiee
        wrote on last edited by
        #3

        Thanks though I would prefer something a bit easier though. Interesting idea though. I might just write a little app that increments a build number in a .h file and call that per compile. Then include that in the app for use. Shouldn't be too hard. I'm amazed MS after all these years hasn't provided what is a fundemental tool for any developer releasing images for testing.

        B 1 Reply Last reply
        0
        • M montiee

          Thanks though I would prefer something a bit easier though. Interesting idea though. I might just write a little app that increments a build number in a .h file and call that per compile. Then include that in the app for use. Shouldn't be too hard. I'm amazed MS after all these years hasn't provided what is a fundemental tool for any developer releasing images for testing.

          B Offline
          B Offline
          Bram van Kampen
          wrote on last edited by
          #4

          montiee wrote:

          I'm amazed MS after all these years hasn't provided what is a fundemental tool for any developer releasing images for testing.

          So am I, but well, my voting shares in microsoft are insufficient to force the issue.

          montiee wrote:

          I would prefer something a bit easier though. Interesting idea though. I might just write a little app that increments a build number in a .h file and call that per compile. Then include that in the app for use

          Well, thought of that, even wrote it. Would not use a .h file target for that though, try to line it in as a 'Pre Compile Step'

          montiee wrote:

          Shouldn't be too hard.

          That's what I thought. Success! BTW it is very very easy to write a piece of code to get the link stamp of an exe. :) :)

          Bram van Kampen

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups