[resolved] How to read out the version info set in the Project options lazarus / 21-General ---------------------------------------------------------------------- Muso · 2022-05-19 16:00 I want to read out the version info I set in the project Option. I found this recipe: https://wiki.freepascal.org/Show_Application_Title,_Version,_and_Compa ny#FPC_3.0.2B This does however not work: * Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i FileVerInfo:=TFileVersionInfo.Create(nil); has to be Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i FileVerInfo:=TFileVersionInfo.Create; * Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i FileVerInfo.ReadFileInfo;does not exist. How to I cane to load the version info into a TFileVersionInfo?Can anybody update the Wiki page to the current status of FPC 3.2? I use: Lazarus 2.2.0 (rev lazarus_2_2_0) FPC 3.2.2 x86_64-win64-win32/win64 ---------------------------------------------------------------------- wp · 2022-05-19 16:23 I tested the following code with laz2.2.0-fpc3.2.2/64bit on Win 11, and it compiles and runs without any issue: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i uses  fileinfo; procedure TForm1.Button1Click(Sender: TObject);var  FileVerInfo: TFileVersionInfo;  s: String;begin  FileVerInfo := TFileVersionInfo.Create(nil);  try    FileVerInfo.ReadFileInfo;    s := 'Company: ' + FileVerInfo.VersionStrings.Values['CompanyName'] + LineEnding +         'File description: ' + FileVerInfo.VersionStrings.Values['FileDescription'] + lineEnding +       'File version: ' + FileVerInfo.VersionStrings.Values['FileVersion'] + LineEnding +       'Internal name: ' +FileVerInfo.VersionStrings.Values['InternalName'] + LineEnding +         'Legal copyright: ' + FileVerInfo.VersionStrings.Values['LegalCopyright'] + LineEnding +       'Original filename: ' + FileVerInfo.VersionStrings.Values['OriginalFilename'] + LineEnding +       'Product name: ' + FileVerInfo.VersionStrings.Values['ProductName'] + LineEnding +       'Product version: ' + FileVerInfo.VersionStrings.Values['ProductVersion'];    ShowMessage(s);  finally    FileVerInfo.Free;  end; end; ---------------------------------------------------------------------- bobby100 · 2022-05-19 16:42 TVersionInfo from ( \lazarus\lcl\interfaces\mui\vinfo.pas ) works fine if you need just the version (build). Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i var  Info: TVersionInfo;begin  Info := TVersionInfo.Create;  Info.Load(HINSTANCE);  // get just the Build Number  StatusBar1.Panels[0].Text :=    IntToStr(Info.FixedInfo.FileVersion[0]) + '.' +    IntToStr(Info.FixedInfo.FileVersion[1]) + '.' +    IntToStr(Info.FixedInfo.FileVersion[2]) + '.' +    IntToStr(Info.FixedInfo.FileVersion[3]);  Info.Free;end; ---------------------------------------------------------------------- Muso · 2022-05-19 16:59 Quote from: wp on May 19, 2022, 06:23:34 pmI tested the following code with laz2.2.0-fpc3.2.2/64bit on Win 11, and it compiles and runs without any issue: Thanks.This is what I had. I see now that this code worked fine in another program of mine. I found now out the reason it failed for me was that i load other units like versiontypes, versionresource from my previous attempts to get it to work. i removed them et voilá, everything works as described in the Wiki.