Thread: Version number stored in .exe!

  1. #1
    Registered User
    Join Date
    Feb 2015
    Posts
    2

    Version number stored in .exe!

    Hi!

    I am/we developing in C and we have a number of different programs.
    We also have problem to keep track of different versions of a specific exe file.
    Is there any way to add version number when build a file so the version is added in the properties.

    I doing this in a MFC c++ project in a .rc file. Is there a way (or a similar way) of doing this in C?
    Here its stored in the details section with product version 6.0.8:Version number stored in .exe!-version_pic-jpg

  2. #2
    Registered User
    Join Date
    May 2011
    Location
    Around 8.3 light-minutes from the Sun
    Posts
    1,949
    Take a look at /VERSION.
    Quote Originally Posted by anduril462 View Post
    Now, please, for the love of all things good and holy, think about what you're doing! Don't just run around willy-nilly, coding like a drunk two-year-old....
    Quote Originally Posted by quzah View Post
    ..... Just don't be surprised when I say you aren't using standard C anymore, and as such,are off in your own little universe that I will completely disregard.
    Warning: Some or all of my posted code may be non-standard and as such should not be used and in no case looked at.

  3. #3
    Programming Wraith GReaper's Avatar
    Join Date
    Apr 2009
    Location
    Greece
    Posts
    2,739
    Most programs built for something other than windows have a special cmd-line argument, "--version" or "-v", that prints the version.
    Devoted my life to programming...

  4. #4
    Registered User
    Join Date
    May 2011
    Location
    Around 8.3 light-minutes from the Sun
    Posts
    1,949
    Quote Originally Posted by GReaper View Post
    Most programs built for something other than windows have a special cmd-line argument, "--version" or "-v", that prints the version.
    I think the OP was looking to add a version number to his program, which is what the link I provided did for M$ compilers.
    Quote Originally Posted by anduril462 View Post
    Now, please, for the love of all things good and holy, think about what you're doing! Don't just run around willy-nilly, coding like a drunk two-year-old....
    Quote Originally Posted by quzah View Post
    ..... Just don't be surprised when I say you aren't using standard C anymore, and as such,are off in your own little universe that I will completely disregard.
    Warning: Some or all of my posted code may be non-standard and as such should not be used and in no case looked at.

  5. #5
    Programming Wraith GReaper's Avatar
    Join Date
    Apr 2009
    Location
    Greece
    Posts
    2,739
    They asked "Is there a way (or a similar way) of doing this in C?", that's why I mentioned it.
    Devoted my life to programming...

  6. #6
    Registered User
    Join Date
    Feb 2015
    Posts
    2
    Thanks for the answers. I took a look at the /VERSION. I should have told you, we use VS6 as development environment and I cant find that option in that old version of environment. And the information about /VERSION was not enough for me, so even if I could set it in the linker I was not able to understand how to see the version with /VERSION option, anyone know? I don't understand this text (maybe my bad english...):
    Use DUMPBIN /HEADERS to see the image version field of the OPTIONAL HEADER VALUES to see the effect of /VERSION.
    The easiest way would be to right click at the .exe and see the version under properties -> details, but the command line argument is a possible road to take.
    Last edited by Marreoragarn; 02-24-2015 at 10:18 AM.

  7. #7
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,981
    From the link:
    The information specified with /VERSION does not affect the version information that appears for an application when you view its properties in File Explorer. That version information comes from a resource file that is used to build the application. See Version Information Editor for more information.
    Click on "Resource View", right click, "Insert...", select "Version".

    gg

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. can't print number stored in array
    By vsg24 in forum C Programming
    Replies: 4
    Last Post: 01-12-2015, 11:37 AM
  2. Making my own version of the scanf() version
    By Jamie_Edwards in forum C Programming
    Replies: 4
    Last Post: 04-30-2012, 09:46 AM
  3. How objects are stored
    By MTK in forum C++ Programming
    Replies: 42
    Last Post: 12-01-2009, 05:29 PM
  4. Linux Version number and hardwares list
    By arunarora in forum C++ Programming
    Replies: 3
    Last Post: 05-25-2009, 03:17 AM
  5. Operating System version number
    By rehan in forum Windows Programming
    Replies: 5
    Last Post: 08-29-2008, 11:39 AM

Tags for this Thread