# FileGetVersionInfo()

作者: SKAN, wOxxOm 最近更新时间: nonexistent

Extracts and returns version information ( any one at a time ) from an executable file.
AHK's FileGetVersion command will fetch you the FileVersion, but there are more - that this function would fetch. Following are Windows Standard Names
* Comments
* CompanyName
* FileDescription
* FileVersion
* InternalName
* LegalCopyright
* LegalTrademarks
* OriginalFilename
* PrivateBuild
* ProductName
* ProductVersion
* SpecialBuild

FileGetVersionInfo( peFile="", StringFileInfo="" )

关于函数的参数和返回值, 请参阅其源码.

#### 备注

Credit: ::script::GetFullVersionInfo string version info for execs by wOxxOm
o http://www.autohotkey.com/forum/viewtopic.php?p=52148#52148
Reference: How to extract version information using the Windows API Peter D Johnson
o http://www.autohotkey.com/forum/viewtopic.php?p=52148#52148

关于此函数(集)的更新细节和注意事项, 请参见 AutoHotkey 论坛: http://www.autohotkey.com/forum/viewtopic.php?p=233188#233188

#### 许可

不存在

#### 示例

    ; #Include FileGetVersionInfo.ahk
    #NoEnv
    SendMode Input
    SetWorkingDir %A_ScriptDir%

    SetBatchLines -1
    Loop, %A_WinDir%\System32\*.??l
      Files .= "|" A_LoopFileLongPath
    Files := A_AhkPath . Files

    Loop, Parse, Files, |
      MsgBox, 0, % (PeFile:=A_LoopField)
      , % "FileDescription      `t:`t" FileGetVersionInfo( PeFile, "FileDescription"  ) "`n"
        . "FileVersion          `t:`t" FileGetVersionInfo( PeFile, "FileVersion"      ) "`n"
        . "InternalName         `t:`t" FileGetVersionInfo( PeFile, "InternalName"     ) "`n"
        . "LegalCopyright       `t:`t" FileGetVersionInfo( PeFile, "LegalCopyright"   ) "`n"
        . "OriginalFilename     `t:`t" FileGetVersionInfo( PeFile, "OriginalFilename" ) "`n"
        . "ProductName          `t:`t" FileGetVersionInfo( PeFile, "ProductName"      ) "`n"
        . "ProductVersion       `t:`t" FileGetVersionInfo( PeFile, "ProductVersion"   ) "`n`n`n"
        . "CompanyName          `t:`t" FileGetVersionInfo( PeFile, "CompanyName"      ) "`n"
        . "PrivateBuild         `t:`t" FileGetVersionInfo( PeFile, "PrivateBuild"     ) "`n"
        . "SpecialBuild         `t:`t" FileGetVersionInfo( PeFile, "SpecialBuild"     ) "`n"
        . "LegalTrademarks      `t:`t" FileGetVersionInfo( PeFile, "LegalTrademarks"  ) "`n"