Ich verwende diese Version hier:
Delphi-Quellcode:
function GetVersionOfApp(FileName : String) : String;
var
VerInfoSize, VerValueSize, Dummy : DWORD;
VerInfo : Pointer;
VerValue : PVSFixedFileInfo;
begin
Result := '0.0.0.0';
if FileExists(Filename) then
begin
VerInfoSize := GetFileVersionInfoSize(PChar(FileName), Dummy);
if VerInfoSize = 0 then Exit;
GetMem(VerInfo, VerInfoSize);
try
GetFileVersionInfo(PChar(FileName), 0, VerInfoSize, VerInfo);
if VerInfo <> nil then
begin
VerQueryValue(VerInfo, '\', Pointer(VerValue), VerValueSize);
with VerValue^ do
begin
Result := IntToStr(dwFileVersionMS shr 16);
Result := Result + '.' + IntToStr(dwFileVersionMS and $FFFF);
Result := Result + '.' + IntToStr(dwFileVersionLS shr 16);
Result := Result + '.' + IntToStr(dwFileVersionLS and $FFFF);
end;
end;
finally
FreeMem(VerInfo, VerInfoSize);
end;
end;
end;
Wenn du meine Version verwendest, kommt dann die richtige Version heraus?