FileVersionInfo did not work with a DLL lazarus / 34-Windows ---------------------------------------------------------------------- af0815 · 2018-07-12 12:39 I have created a library with lazarus under windows with added Versions Info. The Windows explorer show this, but if i want to read the Versions Info from a programm with Lazarus i got the exception Quote... raised exeption class 'EResourceReaderNotFound' with message Cannot find resource reader for extension dll. How can i solve this ? Edit: the winpeimagereader should can handle this, but did not work. ---------------------------------------------------------------------- Phil · 2018-07-12 12:56 Quote from: af0815 on July 12, 2018, 02:39:16 pmI have created a library with lazarus under windows with added Versions Info. The Windows explorer show this, but if i want to read the Versions Info from a programm with Lazarus i got the exception Quote... raised exeption class 'EResourceReaderNotFound' with message Cannot find resource reader for extension dll. How can i solve this ? Edit: the winpeimagereader should can handle this, but did not work. Are you using the FPC fileinfo unit? That reads version info resource data from an executable. You can see how it's used in the VersInfoList unit that's part of LazXProj: https://macpgmr.github.io/MacXPlatform/LazXProj.html ---------------------------------------------------------------------- af0815 · 2018-07-12 13:19 Yes, i am using the fileinfo unit from FPC under Windows. in winpeimagereader there is the definition on the end of the file Quoteinitialization   TResources.RegisterReader('.exe',TWinPEImageResourceReader);   TResources.RegisterReader('.dll',TWinPEImageResourceReader);   TResources.RegisterReader('.bpl',TWinPEImageResourceReader); end. So it should be possible to work with a dll too. The header of the dll looks ok. The MZ and PE Signature is ok. The PE Signature is starting on $80. No diffence to a exe file. I am working on a Windows10/64 PC. 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   FileUtil, fileinfo;    ......  TDllInfo = class(TObject)    FileName : String;    ModulName : String;    Info : string;  end; ....... procedure FindModules(const aDir: string; var aList: TstringList);var  i: Integer;  FileVerInfo:TFileVersionInfo;  FileName, ModulName: String;  aDllInfo : TDllInfo;begin  FileVerInfo:= TFileVersionInfo.Create(nil);  try    with FindAllFiles(aDir,'*.dll', false) do begin      for i:= 0 to Count-1 do begin        FileName := Strings[i];//        FileName := paramstr(0);  //ChangeFileExt(FileName,'.exe');        FileVerInfo.FileName:= FileName;        try          FileVerInfo.ReadFileInfo;          ModulName:= FileVerInfo.VersionStrings.Values['InternalName'];        if ModulName <> '' then begin            aDllInfo := TDllInfo.Create;            aDllInfo.FileName:= Strings[i];          aDllInfo.ModulName:= ModulName;            aDllInfo.Info:= FileVerInfo.VersionStrings.Values['FileDescription'];            aList.AddObject(aDllInfo.FileName,aDllInfo);          end;        finally          ; // nothing to do        end;      end;    end;  finally    FileVerInfo.Free;  end;end; ---------------------------------------------------------------------- ASerge · 2018-07-12 16:27 Similar question in Exception in TFileVersionInfo.ReadFileInfo ---------------------------------------------------------------------- af0815 · 2018-07-13 04:26 I have found the soloution for MY Prablem - for the records:  If you use the unit fileinfo there is a different between local using - eg. for the same file - and using for other files (exe,dll). Local - only fileinfo in uses nesserary, no reader have to declared Other files - you have to define the readers for the files you expected - in my enviroment winpeimagereader ( found in fpcsrc/packages/fcl-res/src) The soloution for me is, i have to add winpeimagereader in the uses line. ---------------------------------------------------------------------- ASBzone · 2018-07-18 15:12 Also see this thread.   I experienced this problem as well, and the fix was already applied to truck... https://forum.lazarus.freepascal.org/index.php/topic,41174.msg285219.h tml#msg285219