Yo tengo esto, echa un vistazo a las diferencias:
Código Delphi
[-]function GetmVersion(cExe:string='') : string;
var
InfoSize, H, RsltLen: Cardinal;
VersionBlock: Pointer;
Rslt: PVSFixedFileInfo;
begin
if (cExe='') or (not FileExists(cExe)) then
cExe := Application.ExeName;
InfoSize := GetFileVersionInfoSize(PChar(cExe), H);
VersionBlock := AllocMem(InfoSize);
try
GetFileVersionInfo(PChar(cExe), H, InfoSize, VersionBlock);
VerQueryValue(VersionBlock, '\', Pointer(Rslt), RsltLen);
Result := Format('%d.%d.%d.%d', [
Rslt.dwProductVersionMS div 65536,
Rslt.dwProductVersionMS mod 65536,
Rslt.dwProductVersionLS div 65536,
Rslt.dwProductVersionLS mod 65536]);
finally
FreeMem(VersionBlock);
end;
end;