Examples Delphi

procedure GetBuildInfo(var V1, V2, V3, V4: Word);
function strBuildInfo: String;
procedure GetBuildInfo(var V1, V2, V3, V4: Word);
var
VerInfoSize,
VerValueSize,
Dummy : DWORD;
VerInfo : Pointer;
VerValue : PVSFixedFileInfo;
begin
VerInfoSize := GetFileVersionInfoSize(PChar(ParamStr(0)), Dummy);
GetMem(VerInfo, VerInfoSize);
GetFileVersionInfo(PChar(ParamStr(0)), 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);
end;
function strBuildInfo: String;
var
V1, V2, V3, V4: Word;
begin
GetBuildInfo(V1, V2, V3, V4);
Result := IntToStr(V1) + '.' +
IntToStr(V2) + '.' +
IntToStr(V3) + '.' +
IntToStr(V4);
end;