Important: The information in this document is obsolete and should not be used for new development.
Providing Version Resources
You can use version('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 version 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 version 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.) You can use version 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 version resource with a resource ID number of 1 specifies the version of the
file; the version resource with a resource ID number of 2 specifies the version of the set
of files.Each version resource should contain these elements:
Listing 7-9 illustrates the version resources for a graphics application and for the document-processing system of which it is a part. Notice that the paint program is version 1.0 while the set of files that compose the entire document-processing system
- Major revision level in binary-coded decimal format. Although the Finder doesn't display it anywhere, you can store this information here; most programming environments provide a tool for setting this element.
- Minor revision level in binary-coded decimal format. Although the Finder doesn't display it anywhere, you can store this information here; most programming environments provide a tool for setting this element.
- Development stage. You can use any of these values or the constants that
represent them:
Value Constant Description 0x20 development
Prealpha file 0x40 alpha
Alpha file 0x60 beta
Beta file 0x80 release
Released file - Prerelease revision level. This number specifies the version if the software is still prerelease.
- Region code. This identifies the script system for which this version of the software is intended. See the chapter "Script Manager" in Inside Macintosh: Text for information about the values represented by the various region codes that can be specified here.
- Version number. This string identifies the version number of the software. When 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, the Finder window containing this application displays this string.
- Version message. This string identifies the version number and either a company copyright for a file or a product name for a superset of files. When the user selects this file and chooses the Get Info command, the Finder displays this string in the information window as follows:
- For a version resource with a resource ID number of 1, this string is displayed in the version field of the information window.
- For a version resource with a resource ID number of 2, this string is displayed beneath the file's name next to the file's icon at the top of the information window.
is version 2.0.Listing 7-9 Rez input for a pair of version resources
resource 'vers' (1, purgeable) { 0x01, 0x00, release, 0x00, verUS, "1.0", "1.0 (US), © My Company, Inc. 1992" }; resource 'vers' (2, purgeable) { 0x02, 0x00, release, 0x00, verUS, "2.0", "(for SurfWriter 3.0)" };Figure 7-13 illustrates how the Finder displays the information from these resources in its information window.You can store version resources in any kind of file, not just an application. If your application does not contain a version resource with a resource ID number of 1, the Finder displays the string from your signature resource as the version information
in the information window for your application.