FileVerInfo

Returns a version resource string from a binary file.

Syntax:

FileVerInfo(filename, language-key, resource-string)

Parameters:

(s) filename name of the EXE, DLL, or other binary file containing version resource information.

(s) language-key  a hexadecimal string identifying the desired language and character-set block within the file's resource table.

(s) resource-string specifies the item to return. (see below.)

Returns:

(s) version resource string from binary file or a blank string ("") if the specified item was not found.

 

Note : If you specify blank strings for both "language-key" and "resource-string", it will now return a tab-delimited list of language keys for which version information is available in the specified file.

"language-key" is a hexadecimal string identifying the desired language and character-set block within the file's resource table. U.S. English (w/ Windows Multilingual character set) is "040904E4".

You can specify a blank string ("") to indicate U.S. English, which will almost always be appropriate. if you specify a blank string for "language-key", it will try to look up the item under the following language keys, in the specified order:

 

language-key language character set

040904E4 U.S. English Windows Multilingual

040904B0 U.S. English Unicode

000004E4 Neutral  Windows Multilingual

04090000 U.S. English Neutral

00000000 Neutral  Neutral

000004B0 Neutral Unicode).

 

Here are some other possible combinations:

Specify one each of the following "Language Codes" and "Character Set":

 

Example:

Language code for French Canadian =

0C0C Character Set is probably Windows, Multilingual =04E4

 

Format:

[Language code][Character Set]

[0C0C] [04E4]

The language key For French-Canadian is 0C0C04E4

 

Language codes

0401 Arabic

0402 Bulgarian

0403 Catalan

0404 Traditional Chinese

0405 Czech

0406 Danish

0407 German

0408 Greek

0409 U.S. English

040A Castilian Spanish

040B Finnish

040C French

040D Hebrew

040E Hungarian

040F Icelandic

0410 Italian

0411 Japanese

0412 Korean

0413 Dutch

0414 Norwegian - Bokml

0810 Swiss Italian

0813 Belgian Dutch (Cyrillic)

0814 Norwegian - Nynorsk

0415 Polish

0416 Brazilian Portuguese

0417 Rhaeto-Romanic

0418 Romanian

0419 Russian

041A Croato-Serbian (Latin)

041B Slovak

041C Albanian

041D Swedish

041E Thai

041F Turkish

0420 Urdu

0421 Bahasa

0804 Simplified Chinese

0807 Swiss German

0809 U.K. English

080A Mexican Spanish

080C Belgian French

0C0C Canadian French

100C Swiss French

0816 Portuguese

081A Serbo-Croatian (Cyrillic)

Character Set

0000 7-bit ASCII

03A4 Windows, Japan (SHIFT - JIS X-0208)

03B5 Windows, Korea (SHIFT - KSC 5601)

03B6 Windows, Taiwan (GB5)

04B0 Unicode

04E2 Windows, Latin-2 (Eastern European)

04E3 Windows, Cyrillic

04E4 Windows, Multilingual

04E5 Windows, Greek

04E6 Windows, Turkish

04E7 Windows, Hebrew

04E8 Windows, Arabic

"resource-string" specifies the item to return. The following are standard item names (although some of these are optional and will not necessarily be present In any particular file):

"Comments"  

"LegalCopyright"

"CompanyName"

"LegalTrademarks"

"FileDescription"

"OriginalFilename"

"FileVersion"

"ProductName"

"InternalName"

"ProductVersion"

"ToolsetBuildInfo"

 

Note: FileVerInfo can return numeric version fields, by preceding the resource string name with a '#'.

The following are available:

"#FileVersion"

"#ProductVersion"

"#FileFlagsMask"

"#FileFlags"

"#FileOS"

"#FileType"

"#FileSubtype"

 

"#FileVersion" and "#ProductVersion" are 64-bit numbers, and are returned as comma-separated strings In the form "n1,n2,n3,n4", where n1 is the most significant word and n4 is the least significant word. The other fields each return a SINGLE 32-bit number.

This function supports extended-length path names.

Example:

FileN = FileLocate("explorer.exe") ErrorMode(@OFF) FComments = FileVerInfo(FileN, "", "Comments") FCompany = FileVerInfo(FileN, "", "CompanyName") FDescription = FileVerInfo(FileN, "", "FileDescription") FVersion = FileVerInfo(FileN, "", "FileVersion") FInternalName = FileVerInfo(FileN, "", "InternalName") FLegalCopyright = FileVerInfo(FileN, "", "LegalCopyright") FOriginalFilename = FileVerInfo(FileN, "", "OriginalFilename") FProductName = FileVerInfo(FileN, "", "ProductName") FProductVersion = FileVerInfo(FileN, "", "ProductVersion") ErrorMode(@CANCEL)
MyDialogFormat=`WWWDLGED,6.2` MyDialogCaption=`FileVerInfo` MyDialogX=004 MyDialogY=021 MyDialogWidth=240 MyDialogHeight=147 MyDialogNumControls=019 MyDialogProcedure=`DEFAULT` MyDialogFont=`DEFAULT` MyDialogTextColor=`DEFAULT` MyDialogBackground=`DEFAULT,DEFAULT` MyDialogConfig=0 MyDialog001=`067,003,168,014,VARYTEXT,"VaryText_1",FComments,DEFAULT,DEFAULT,1,DEFAULT,DEFAULT,DEFAULT,DEFAULT` MyDialog002=`003,003,066,014,STATICTEXT,"StaticText_Comments:",DEFAULT,"Comments:",DEFAULT,2,DEFAULT,DEFAULT,DEFAULT,DEFAULT` MyDialog003=`003,017,064,014,STATICTEXT,"StaticText_Company:",DEFAULT,"Company:",DEFAULT,3,DEFAULT,DEFAULT,DEFAULT,DEFAULT` MyDialog004=`067,017,168,014,VARYTEXT,"VaryText_2",FCompany,DEFAULT,DEFAULT,4,DEFAULT,DEFAULT,DEFAULT,DEFAULT` MyDialog005=`003,031,064,014,STATICTEXT,"StaticText_Description:",DEFAULT,"Description:",DEFAULT,5,DEFAULT,DEFAULT,DEFAULT,DEFAULT` MyDialog006=`067,031,168,014,VARYTEXT,"VaryText_3",FDescription,DEFAULT,DEFAULT,6,DEFAULT,DEFAULT,DEFAULT,DEFAULT` MyDialog007=`003,045,064,014,STATICTEXT,"StaticText_Version:",DEFAULT,"Version:",DEFAULT,7,DEFAULT,DEFAULT,DEFAULT,DEFAULT` MyDialog008=`067,045,168,014,VARYTEXT,"VaryText_4",FVersion,DEFAULT,DEFAULT,8,DEFAULT,DEFAULT,DEFAULT,DEFAULT` MyDialog009=`003,059,064,014,STATICTEXT,"StaticText_5",DEFAULT,"Internal Name:",DEFAULT,9,DEFAULT,DEFAULT,DEFAULT,DEFAULT` MyDialog010=`067,059,168,014,VARYTEXT,"VaryText_5",FInternalName,DEFAULT,DEFAULT,10,DEFAULT,DEFAULT,DEFAULT,DEFAULT` MyDialog011=`003,073,064,014,STATICTEXT,"StaticText_6",DEFAULT,"Legal Copyright:",DEFAULT,11,DEFAULT,DEFAULT,DEFAULT,DEFAULT` MyDialog012=`067,073,168,014,VARYTEXT,"VaryText_6",FLegalCopyright,DEFAULT,DEFAULT,12,DEFAULT,DEFAULT,DEFAULT,DEFAULT` MyDialog013=`003,087,064,014,STATICTEXT,"StaticText_7",DEFAULT,"Original Filename:",DEFAULT,13,DEFAULT,DEFAULT,DEFAULT,DEFAULT` MyDialog014=`067,087,168,014,VARYTEXT,"VaryText_7",FOriginalFilename,DEFAULT,DEFAULT,14,DEFAULT,DEFAULT,DEFAULT,DEFAULT` MyDialog015=`003,101,064,014,STATICTEXT,"StaticText_8",DEFAULT,"Product Name:",DEFAULT,15,DEFAULT,DEFAULT,DEFAULT,DEFAULT` MyDialog016=`067,101,168,014,VARYTEXT,"VaryText_8",FProductName,DEFAULT,DEFAULT,16,DEFAULT,DEFAULT,DEFAULT,DEFAULT` MyDialog017=`003,115,064,014,STATICTEXT,"StaticText_9",DEFAULT,"Product Version:",DEFAULT,17,DEFAULT,DEFAULT,DEFAULT,DEFAULT` MyDialog018=`067,115,168,014,VARYTEXT,"VaryText_9",FProductVersion,DEFAULT,DEFAULT,18,DEFAULT,DEFAULT,DEFAULT,DEFAULT` MyDialog019=`087,129,064,014,PUSHBUTTON,"PushButton_Ok",DEFAULT,"Ok",1,19,DEFAULT,DEFAULT,DEFAULT,DEFAULT` ButtonPushed=Dialog("MyDialog")
See Also:

DOSVersion, Environment, Version, VersionDLL, WinVersion