forked from P33a/SimTwo
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVerInfo.pas
More file actions
47 lines (34 loc) · 1.04 KB
/
VerInfo.pas
File metadata and controls
47 lines (34 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
unit VerInfo;
{$mode objfpc}{$H+}
interface
uses
SysUtils, Classes, Forms
// FPC 3.0 fileinfo reads exe resources as long as you register the appropriate units
, fileinfo
, winpeimagereader {need this for reading exe info}
//, elfreader {needed for reading ELF executables}
//, machoreader {needed for reading MACH-O executables}
;
const
InfoNum = 10;
InfoKey: array[1..InfoNum] of string = ('CompanyName', 'FileDescription', 'FileVersion', 'InternalName', 'LegalCopyright', 'LegalTradeMarks', 'OriginalFileName', 'ProductName', 'ProductVersion', 'Comments');
var
InfoData: array[1..InfoNum] of string;
procedure GetVersionInfo;
implementation
procedure GetVersionInfo;
var
FileVerInfo: TFileVersionInfo;
i: integer;
begin
FileVerInfo:=TFileVersionInfo.Create(nil);
try
FileVerInfo.ReadFileInfo;
for i := low(InfoKey) to high(InfoKey) do begin
InfoData[i] := FileVerInfo.VersionStrings.Values[InfoKey[i]];
end;
finally
FileVerInfo.Free;
end;
end;
end.