Connecting Tech Pros Worldwide Forums | Help | Site Map

Code verison in executable file

Newbie
 
Join Date: Apr 2008
Posts: 2
#1: Apr 3 '08
Hi,

is there a straight forward way to have version information embedded in an executable? What I would like is to release a file and when the user does something like "program -v" they will be presented with the version information. The only way I can see just now to do it would be to parse the command line arguments looking for the -v option.

Is there any other ways of doing it - maybe by embedding something into the executable so that another command can help, such as 'file'?

Regards,

John.

micmast's Avatar
Familiar Sight
 
Join Date: Mar 2008
Location: Belgium
Posts: 136
#2: Apr 3 '08

re: Code verison in executable file


looks doubtfull to me, I could be wrong, but I don't think file or any other file could do that.
Expert
 
Join Date: Nov 2006
Posts: 392
#3: Apr 7 '08

re: Code verison in executable file


Quote:

Originally Posted by j0hnb

is there a straight forward way to have version information embedded in an executable?

Sure, but the way it would be done would depend on the language the executable was compiled from.



Quote:

Originally Posted by j0hnb

What I would like is to release a file and when the user does something like "program -v" they will be presented with the version information. The only way I can see just now to do it would be to parse the command line arguments looking for the -v option.

Yep that is the way it works. Generally any executable should be parsing and validating any arguments passed to it.
Reply