Greetings,
I'm running the 32-bit version of Lazarus 1.8.2 with FPC 3.0.4 on Windows 10 x64 (Build 1709)
I have tested the following program which obtains file version information from executables on Windows and other platforms.
http://wiki.freepascal.org/Show_Application_Title,_Version,_and_CompanyIt works on *most* Windows binaries which have file version info. BUT, I found that there are some that it does not read problem -- it raises an exception in the the
FileInfo unit, during
.Load.
One of the utilities that generated the most interesting failure was ADFIND.EXE from
www.joeware.net, but others include BlueScreenInfo.exe from Nirsoft.
Meanwhile,
FILEVER.EXE from Microsoft and
SIGCHECK.EXE from SysInternals (now owned by Microsoft), are able to get the file info correctly for all of these files.
I dug around in the FileInfo, VersionResource, VersionTypes and Resource units, and found that the way that the data is being read -- especially for ADFIND.EXE -- was jumbling the keys for some reason. In particular, the FileDescription field, which appears to be blank, contains info that contains the FileVersion field name, throwing everything off after that.
I've attached some examples of files that fail with the TFileVersionInfo routines, but not with the 3rd party file version routines.
Is there something about the resource reading routines that could be adjusted to address these scenarios?
-ASB