Version Resources
You can use 'vers' resources to record version information for your
application. If the user opens the Views control panel, clicks the Show Version
box, and then chooses any command from the View menu other than by Icon or
by Small Icon, filenames and their version numbers from the 'vers' resource appear in the active Finder window. The Finder also displays version information when the user selects your application and chooses Get Info from
the File menu.
The 'vers' resource allows you to store a version number, a version message, and a region code. (Because the Get Info command's information window already
displays the name of your application, the version message should not include
the name of your application.) Each 'vers' resource uses this Rez template:
byte; /* first part of version number in BCD */
byte; /* second and third parts of version number */
byte; /* development=0x20, alpha=0x40, beta=0x60, release=0x80 */
byte; /* stage of prerelease version */
integer; /* region code, as in International Utilities */
p string; /* version number */
p string; /* version message */
}
You can use 'vers' resources to assign version information to an individual
file and, if it is a part of a larger collection of files, to the entire superset of
files. The 'vers' resource with a resource ID of 1 specifies the version of the
file; the 'vers' resource with a resource ID of 2 specifies the version of the set
of files.
The following sample code illustrates the 'vers' resources, in Rez input
format, for a spelling checker application and for the word-processing system
of which it is a part. Notice that the spelling checker is version 1.1 while the
set of files that compose the entire word-processing system is version 2.0.
0x01, 0x01, release, 0x00, verUS,
"1.1",
"1.1 (US), © My Company, Inc. 1991
};
0x02, 0x00, release, 0x00, verUS,
"2.0",
"(for SurfWriter 2.0)
};
You can store version resources in any kind of file, not just an application. If
your application does not contain a 'vers' resource with a resource ID of 1, the
information in the information window for your application.