Как узнать версию программы? |
|
Написал Ярослав Гасов
|
13.05.2009 |
function GetFileVersion(const FileName: TFileName; var Major, Minor, Release, Build: Integer): Boolean; var InfoSize, Wnd: DWORD; VerBuf: Pointer; FI: PVSFixedFileInfo; VerSize: DWORD;
begin Result:= False; InfoSize:= GetFileVersionInfoSize(PChar(FileName), Wnd); if InfoSize <> 0 then begin GetMem(VerBuf, InfoSize); try if GetFileVersionInfo(PChar(FileName), Wnd, InfoSize, VerBuf) then if VerQueryValue(VerBuf, '\', Pointer(FI), VerSize) then begin Major:= FI.dwFileVersionMS shr 16; Minor:= FI.dwFileVersionMS and $FFFF; Release:= FI.dwFileVersionLS shr 16; Build:= FI.dwFileVersionLS and $FFFF; Result:= True; end; finally FreeMem(VerBuf); end; end; end; |
Последнее обновление ( 13.05.2009 )
|