您的位置:首页 > 其它

VERSIONINFO Resource

2016-05-16 14:38 405 查看
转自(http://www.xuebuyuan.com/1202062.html)

VERSIONINFO Resource

Defines a version-information resource. The resource contains such information about the file as its version number, its intended operating system, and its original filename. The resource is intended to be used with theVersion Information functions.

There are two ways to format a VERSIONINFO statement:

versionID VERSIONINFO fixed-info  { block-statement . . . }


- or -

versionID VERSIONINFO
fixed-info
BEGIN
block-statement
. . .
END


Parameters

versionID
Version-information resource identifier. This value must be 1.

fixed-info
Version information, such as the file version and the intended operating system. This parameter consists of the following statements.

StatementDescription
FILEVERSIONversionBinary version number for the file. The version consists of two
32-bit integers, defined by four 16-bit integers. For example, "FILEVERSION
3,10,0,61" is translated into two doublewords: 0x0003000a and 0x0000003d, in
that order. Therefore, if version is defined by the
DWORD values dw1 and dw2, they need to appear
in the FILEVERSION statement as follows:
HIWORD(dw1)
,
LOWORD(dw1)
,
HIWORD(dw2)
,
LOWORD(dw2)
.
PRODUCTVERSIONversionBinary version number for the product with which the file is distributed.
The version parameter is two 32-bit integers, defined by four 16-bit
integers. For more information about version, see the
FILEVERSION description.
FILEFLAGSMASKfileflagsmaskBits in the FILEFLAGS statement are valid. If a bit is set,
the corresponding bit in FILEFLAGS is valid.
FILEFLAGS fileflagsAttributes of the file. The fileflags parameter must be the
combination of all the file flags that are valid at compile time. For 16-bit
Windows, this value is 0x3f.
FILEOS fileosOperating system for which this file was designed. The fileos
parameter can be one of the operating system values given in the Remarks
section.
FILETYPE filetypeGeneral type of file. The filetype parameter can be one of the file
type values listed in the Remarks section.
FILESUBTYPEsubtypeFunction of the file. The subtype parameter is zero unless the
filetype parameter in the FILETYPE statement is
VFT_DRV, VFT_FONT, or VFT_VXD. For a list of file subtype values, see the
Remarks section.
block-statement
Specifies one or more version-information blocks. A block can contain string information or variable information. For more information, see StringFileInfo Block or VarFileInfo Block.

Remarks

To use the constants specified with the VERSIONINFO statement, you must include the Winver.h or Windows.h header file in the resource-definition file.

The following list describes the parameters used in the
VERSIONINFO statement:

fileflags
A combination of the following values.

ValueDescription
VS_FF_DEBUGFile contains debugging information or is compiled with debugging features
enabled.
VS_FF_PATCHEDFile has been modified and is not identical to the original shipping file of
the same version number.
VS_FF_PRERELEASEFile is a development version, not a commercially released
product.
VS_FF_PRIVATEBUILDFile was not built using standard release procedures. If this value is
given, the StringFileInfo block must
contain a PrivateBuild string.
VS_FF_SPECIALBUILDFile was built by the original company using standard release procedures but
is a variation of the standard file of the same version number. If this value is
given, the StringFileInfo block block
must contain a SpecialBuild string.
VS_FFI_FILEFLAGSMASKA combination of all the preceding values.
fileos
One of the following values.

ValueDescription
VOS_UNKNOWNThe operating system for which the file was designed is unknown.
VOS_DOSFile was designed for MS-DOS.
VOS_NTFile was designed for 32-bit Windows.
VOS__WINDOWS16File was designed for 16-bit Windows.
VOS__WINDOWS32File was designed for 32-bit Windows.
VOS_DOS_WINDOWS16File was designed for 16-bit Windows running with MS-DOS.
VOS_DOS_WINDOWS32File was designed for 32-bit Windows running with MS-DOS.
VOS_NT_WINDOWS32File was designed for 32-bit Windows.
The values 0x00002L, 0x00003L, 0x20000L and 0x30000L are reserved.

filetype
One of the following values.

ValueDescription
VFT_UNKNOWNFile type is unknown.
VFT_APPFile contains an application.
VFT_DLLFile contains a dynamic-link library (DLL).
VFT_DRVFile contains a device driver. If filetype is VFT_DRV,
subtype contains a more specific description of the driver.
VFT_FONTFile contains a font. If filetype is VFT_FONT, subtype
contains a more specific description of the font.
VFT_VXDFile contains a virtual device.
VFT_STATIC_LIBFile contains a static-link library.
All other values are reserved for use by Microsoft.

subtype
Additional information about the file type.

If filetype specifies VFT_DRV, this parameter can be one of the
following values.

ValueDescription
VFT2_UNKNOWNDriver type is unknown.
VFT2_DRV_COMMFile contains a communications driver.
VFT2_DRV_PRINTERFile contains a printer driver.
VFT2_DRV_KEYBOARDFile contains a keyboard driver.
VFT2_DRV_LANGUAGEFile contains a language driver.
VFT2_DRV_DISPLAYFile contains a display driver.
VFT2_DRV_MOUSEFile contains a mouse driver.
VFT2_DRV_NETWORKFile contains a network driver.
VFT2_DRV_SYSTEMFile contains a system driver.
VFT2_DRV_INSTALLABLEFile contains an installable driver.
VFT2_DRV_SOUNDFile contains a sound driver.
VFT2_DRV_VERSIONED_PRINTERFile contains a versioned printer driver.
If filetype specifies VFT_FONT, this parameter can be one of the
following values.

ValueDescription
VFT2_UNKNOWNFont type is unknown.
VFT2_FONT_RASTERFile contains a raster font.
VFT2_FONT_VECTORFile contains a vector font.
VFT2_FONT_TRUETYPEFile contains a TrueType font.
If filetype specifies VFT_VXD, this parameter must be the
virtual-device identifier included in the virtual-device control block.

All subtype values not listed here are reserved for use by
Microsoft.

langID
One of the following language codes.

CodeLanguageCodeLanguage
0x0401Arabic0x0415Polish
0x0402Bulgarian0x0416Portuguese (Brazil)
0x0403Catalan0x0417Rhaeto-Romanic
0x0404Traditional Chinese0x0418Romanian
0x0405Czech0x0419Russian
0x0406Danish0x041ACroato-Serbian (Latin)
0x0407German0x041BSlovak
0x0408Greek0x041CAlbanian
0x0409U.S. English0x041DSwedish
0x040ACastilian Spanish0x041EThai
0x040BFinnish0x041FTurkish
0x040CFrench0x0420Urdu
0x040DHebrew0x0421Bahasa
0x040EHungarian0x0804Simplified Chinese
0x040FIcelandic0x0807Swiss German
0x0410Italian0x0809U.K. English
0x0411Japanese0x080ASpanish (Mexico)
0x0412Korean0x080CBelgian French
0x0413Dutch0x0C0CCanadian French
0x0414Norwegian – Bokmal0x100CSwiss French
0x0810Swiss Italian0x0816Portuguese (Portugal)
0x0813Belgian Dutch0x081ASerbo-Croatian (Cyrillic)
0x0814Norwegian – Nynorsk
charsetID
One of the following character-set identifiers.

DecimalHexadecimalCharacter Set
000007-bit ASCII
93203A4Japan (Shift – JIS X-0208)
94903B5Korea (Shift – KSC 5601)
95003B6Taiwan (Big5)
120004B0Unicode
125004E2Latin-2 (Eastern European)
125104E3Cyrillic
125204E4Multilingual
125304E5Greek
125404E6Turkish
125504E7Hebrew
125604E8Arabic
string-name
One of the following predefined names.

NameDescription
CommentsAdditional information that should be displayed for diagnostic
purposes.
CompanyNameCompany that produced the file—for example, "Microsoft Corporation" or
"Standard Microsystems Corporation, Inc." This string is required.
FileDescriptionFile description to be presented to users. This string may be displayed in a
list box when the user is choosing files to install—for example, "Keyboard
Driver for AT-Style Keyboards". This string is required.
FileVersionVersion number of the file—for example, "3.10" or "5.00.RC2". This string is
required.
InternalNameInternal name of the file, if one exists—for example, a module name if the
file is a dynamic-link library. If the file has no internal name, this string
should be the original filename, without extension. This string is
required.
LegalCopyrightCopyright notices that apply to the file. This should include the full text
of all notices, legal symbols, copyright dates, and so on. This string is
optional.
LegalTrademarksTrademarks and registered trademarks that apply to the file. This should
include the full text of all notices, legal symbols, trademark numbers, and so
on. This string is optional.
OriginalFilenameOriginal name of the file, not including a path. This information enables an
application to determine whether a file has been renamed by a user. The format
of the name depends on the file system for which the file was created. This
string is required.
PrivateBuildInformation about a private version of the file—for example, "Built by
TESTER1 on /TESTBED". This string should be present only if VS_FF_PRIVATEBUILD
is specified in the fileflags parameter of the root block.
ProductNameName of the product with which the file is distributed. This string is
required.
ProductVersionVersion of the product with which the file is distributed—for example,
"3.10" or "5.00.RC2". This string is required.
SpecialBuildText that indicates how this version of the file differs from the standard
version—for example, "Private build for TESTER1 solving mouse problems on M250
and M250E computers". This string should be present only if VS_FF_SPECIALBUILD
is specified in the fileflags parameter of the root
block.
Certain attributes are also supported for backward compatibility. For more information, see Common Resource Attributes.

Examples

The following example defines a VERSIONINFO resource:

#define VER_FILEVERSION             3,10,349,0
#define VER_FILEVERSION_STR         "3.10.349.0/0"

#define VER_PRODUCTVERSION          3,10,0,0
#define VER_PRODUCTVERSION_STR      "3.10/0"

#ifndef DEBUG
#define VER_DEBUG                   0
#else
#define VER_DEBUG                   VS_FF_DEBUG
#endif

VS_VERSION_INFO VERSIONINFO
FILEVERSION    	VER_FILEVERSION
PRODUCTVERSION 	VER_PRODUCTVERSION
FILEFLAGSMASK  	VS_FFI_FILEFLAGSMASK
FILEFLAGS      	(VER_PRIVATEBUILD|VER_PRERELEASE|VER_DEBUG)
FILEOS         	VOS__WINDOWS32
FILETYPE       	VFT_DLL
FILESUBTYPE    	VFT2_UNKNOWN
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904E4"
BEGIN
VALUE "CompanyName",      VER_COMPANYNAME_STR
VALUE "FileDescription",  VER_FILEDESCRIPTION_STR
VALUE "FileVersion",      VER_FILEVERSION_STR
VALUE "InternalName",     VER_INTERNALNAME_STR
VALUE "LegalCopyright",   VER_LEGALCOPYRIGHT_STR
VALUE "LegalTrademarks1", VER_LEGALTRADEMARKS1_STR
VALUE "LegalTrademarks2", VER_LEGALTRADEMARKS2_STR
VALUE "OriginalFilename", VER_ORIGINALFILENAME_STR
VALUE "ProductName",      VER_PRODUCTNAME_STR
VALUE "ProductVersion",   VER_PRODUCTVERSION_STR
END
END

BLOCK "VarFileInfo"
BEGIN
/* The following line should only be modified for localized versions.     */
/* It consists of any number of WORD,WORD pairs, with each pair           */
/* describing a language,codepage combination supported by the file.      */
/*                                                                        */
/* For example, a file might have values "0x409,1252" indicating that it  */
/* supports English language (0x409) in the Windows ANSI codepage (1252). */

VALUE "Translation", 0x409, 1252

END
END
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: