[SOLVED] Get application version info lazarus / 31-LCL ---------------------------------------------------------------------- tk · 2014-06-30 18:07 Hi, how do I obtain application version (major, minor, revision, build) in other widgetsets than Win32? In Windows I use GetFileVersionInfo but this is win-only. Didn't find anything usable on the forum. Thanks ---------------------------------------------------------------------- Blaazen · 2014-06-30 18:20 It should be unit FileInfo. This worked for me on Linux: Code: [Select]{ TVersion }   TVersion = class (TPersistent)   private     FBuild: Integer;     FMajor: Integer;     FMinor: Integer;     FVersion: Integer;   published     property Version: Integer read FVersion write FVersion;     property Major: Integer read FMajor write FMajor;     property Minor: Integer read FMinor write FMinor;     property Build: Integer read FBuild write FBuild;   end;        ...   aVersionInfo:=TVersionInfo.Create;   VersionInfo:=TVersion.Create;   try     aVersionInfo.Load(HINSTANCE);     VersionInfo.Version:=aVersionInfo.FixedInfo.FileVersion[0];     VersionInfo.Major:=aVersionInfo.FixedInfo.FileVersion[1];     VersionInfo.Minor:=aVersionInfo.FixedInfo.FileVersion[2];     VersionInfo.Build:=aVersionInfo.FixedInfo.FileVersion[3];   finally     if assigned(aVersionInfo) then aVersionInfo.Free;   end; ---------------------------------------------------------------------- tk · 2014-07-01 03:47 Quote from: Blaazen on June 30, 2014, 08:20:26 pmIt should be unit FileInfo. This worked for me on Linux: For me no unit FileInfo can be found under Linux, compiler reports error when added to uses clause. And nor can I find any TVersionInfo class or function in Lazarus and FPC sources. The only things I was able to find is TFileVersionInfo from FPC fcl- base directory but that is Win/WinCE only. ---------------------------------------------------------------------- Zoran · 2014-07-01 04:36 Take a look at this forum thread: http://forum.lazarus.freepascal.org/index.php/topic,12435.0.html Just don't forget to enable version info in the first place (project->project options->version info and check "include version info in executable"). Works in Linux as well as in Windows. ---------------------------------------------------------------------- Mike.Cornflake · 2014-07-01 07:01 The code in this post contains safeguards in case no version information is built into the app... http://forum.lazarus.freepascal.org/index.php/topic,13957.msg73542.htm l#msg73542 ---------------------------------------------------------------------- jwdietrich · 2014-07-01 07:01 Another solution that works very well, even on Mac OS X with Carbon widgetset, is Mike Thompson's VersionSupport unit that is available from http://forum.lazarus.freepascal.org/index.php/topic,13957.0.html. ---------------------------------------------------------------------- BigChimp · 2014-07-01 07:46 And there's this page http://wiki.lazarus.freepascal.org/Show_Application_Title,_Version,_an d_Company ---------------------------------------------------------------------- tk · 2014-07-01 08:18 Marked as solved. Thank you ---------------------------------------------------------------------- Blaazen · 2014-07-01 13:37 QuoteFor me no unit FileInfo can be found under Linux, compiler reports error when added to uses clause.Here (FPC 2.7.1) shows me unit FileInfo is in ..packages/fcl-base/src/fileinfo.pp EDIT: FPC 2.6.4 under Wine knows the unit too (..packages/fcl- base/src/win/fileinfo.pp). ---------------------------------------------------------------------- BigChimp · 2014-07-01 13:40 QuoteFor me no unit FileInfo can be found under Linux, compiler reports error when added to uses clause. That's why there are 2 versions on the wiki page I linked - one for 2.6.x and one for trunk/2.7.1..