> Q.. is there a Dephi call to get Version info of a product > eg Label5.Caption:=label5.Caption+' '+Version; >
Try these (can't recall what Uses you need, but will be one of Windows, Classes, Sysutils) function FileVersion(const FileName: string; var FileInfo: TVSFixedFileInfo): Boolean; var infoSize, puLen: DWord; ptr, infoPtr: Pointer; begin infoSize := GetFileVersionInfoSize(PChar(FileName), puLen); FillChar(FileInfo, SizeOf(FileInfo), 0); if infoSize > 0 then begin GetMem(ptr, InfoSize); try GetFileVersionInfo(PChar(FileName), 0, infoSize, ptr); VerQueryValue(ptr, '\', infoPtr, puLen); Move(infoPtr^, FileInfo, SizeOf(FileInfo)); Result := True; finally FreeMem(ptr); end; end else Result := False; end; // ------------------------------------------------------------------- --- function FileVersionFmt(const FileName: string): string; const VERSION_STRING = '[ version %u.%u.%u.%u ]'; var fileInfo: TVSFixedFileInfo; begin if FileVersion(FileName, fileInfo) then Result := Format(VERSION_STRING, [HiWord(fileInfo.dwProductVersionMS), LoWord(fileInfo.dwProductVersionMS), HiWord(fileInfo.dwProductVersionLS), LoWord(fileInfo.dwProductVersionLS)]) else Result := EmptyStr; end; cheers, peter =========================================== Peter Hyde, SPIS Ltd, Christchurch, New Zealand * TCompress/TCompLHA component sets for Delphi/Kylix/C++ * TurboNote+: http://TurboPress.com/tbnote.htm -- top-rated onscreen sticky notes * Web automation for online periodicals: http://TurboPress.com Find all the above and MORE at http://spis.co.nz --------------------------------------------------------------------------- New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED] Website: http://www.delphi.org.nz To UnSub, send email to: [EMAIL PROTECTED] with body of "unsubscribe delphi" Web Archive at: http://www.mail-archive.com/delphi%40delphi.org.nz/