-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathGetBuildInfo.pas
More file actions
28 lines (28 loc) · 889 Bytes
/
GetBuildInfo.pas
File metadata and controls
28 lines (28 loc) · 889 Bytes
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
function GetBuildInfo:string;
//
// Retorna a versão do aplicativo
//
var
VerInfoSize: DWORD;
VerInfo: Pointer;
VerValueSize: DWORD;
VerValue: PVSFixedFileInfo;
Dummy: DWORD;
V1, V2, V3, V4: Word;
Prog : string;
begin
Prog := Application.Exename;
VerInfoSize := GetFileVersionInfoSize(PChar(prog), Dummy);
GetMem(VerInfo, VerInfoSize);
GetFileVersionInfo(PChar(prog), 0, VerInfoSize, VerInfo);
VerQueryValue(VerInfo, '\', Pointer(VerValue), VerValueSize);
with VerValue^ do
begin
V1 := dwFileVersionMS shr 16;
V2 := dwFileVersionMS and $FFFF;
V3 := dwFileVersionLS shr 16;
V4 := dwFileVersionLS and $FFFF;
end;
FreeMem(VerInfo, VerInfoSize);
result := Copy (IntToStr (100 + v1), 3, 2) + '.' + Copy (IntToStr (100 + v2), 3, 2) + '.' + Copy (IntToStr (100 + v3), 3, 2) + '.' + Copy (IntToStr (100 + v4), 3, 2);
end;