Adding Version Information to an OSX Command-Line Application

On Windows, I will simply add the RC file with the required data. Is it necessary to build the kit, as usual, using info.plist / version.plist or is there a better, standard way? This is for Snow Leopard, and later, if relevant.

thanks ++

+1
source share
2 answers

You can insert the Info.plist file into the executable file as a special Mach-o section. See for example this question .

+2
source

If you have a command-line application, then this is just one file, not the traditional OSX application package (with the Contents folder and the Macros + Resources folder at the bottom).

If you don’t want to make a full-blown Macintosh application package (with a built-in graphical interface and info-plist somewhere out there), there are several different things that I saw in the Macintosh command-line applications.

one)

Add the -v option for the version. Therefore, if the application is called foo, type " foo -v " at the command prompt, output " version 1.0 ".

2)

Put the version number as part of the file name ... so that "foo" is actually "foo1.0".

Oof, that seems awkward. So that...

3)

Some applications have a symbolic link pointing to a real binary file. So foo points to foo1.0 , and if you have to do "ls -l", you will see something like:

 -rwxr-xr-x 1 root wheel 66128 Jul 12 15:39 foo1.0 lrwxr-xr-x 1 root wheel 15 Jul 12 15:39 foo -> foo1.0 

so typing in "foo" on the command line will actually launch foo1.0.

I hope these opinions help you!

0
source

All Articles