How to get file version information in Delphi

It's very simple. Just drop TFileVersion component onto your form, set the FileName property and access all the version information through component properties (OriginalFileName, FileVersion, LegalCopyrights, and so on). The following code copies complete version information into memo.

with memFileVersion.Lines,cmpFileVersion do
begin
  FileName:=edtFileName.Text;
  Clear;
  Add('Original file name'#9+OriginalFileName);
  Add('File description'#9+FileDescription);
  Add('File version'#9+FileVersion);
  Add('Products name'#9+ProductName);
  Add('Products version'#9+ProductVersion);
  Add('Internal name'#9+InternalName);
  Add('Legal copyrights'#9+LegalCopyright);
  Add('Legal trademarks'#9+LegalTrademarks);
  Add('CompanyName'#9+CompanyName);
  Add('Comments'#9+Comments);
end;

Any custom entries are available through array-type VersionValue property.

ShowMessage('Some "Custom" version value: '+cmpFileVersion.VersionValue['Custom']);
See also
File Version
Components for Delphi / C++ Builder
Howtos for Programmers