Recent

Author Topic: [SOLVED] Possible Problem with TFileVersionInfo routines  (Read 2988 times)

ASBzone

  • Hero Member
  • *****
  • Posts: 733
  • Automation leads to relaxation...
    • Free Console Utilities for Windows (and a few for Linux) from BrainWaveCC
[SOLVED] Possible Problem with TFileVersionInfo routines
« on: May 06, 2018, 10:40:15 pm »
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_Company

It 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

« Last Edit: July 25, 2020, 12:31:30 am by ASBzone »
-ASB: https://www.BrainWaveCC.com/

Lazarus v4.3.0.0 (bcf314a670) / FreePascal v3.2.3-46-g77716a79dc (aka fixes)
(Windows 64-bit install w/Win32 and Linux on ARM and x64 cross-compilers via FpcUpDeluxe)

My Systems: Windows 10/11 Pro x64 (Current)

ASBzone

  • Hero Member
  • *****
  • Posts: 733
  • Automation leads to relaxation...
    • Free Console Utilities for Windows (and a few for Linux) from BrainWaveCC
Re: Possible Problem with TFileVersionInfo routines
« Reply #1 on: May 08, 2018, 07:40:43 pm »
Is there any other info that I could provide that would allow folks to potentially help here?  %)

Regards,
-ASB: https://www.BrainWaveCC.com/

Lazarus v4.3.0.0 (bcf314a670) / FreePascal v3.2.3-46-g77716a79dc (aka fixes)
(Windows 64-bit install w/Win32 and Linux on ARM and x64 cross-compilers via FpcUpDeluxe)

My Systems: Windows 10/11 Pro x64 (Current)

hnb

  • Sr. Member
  • ****
  • Posts: 270
Re: Possible Problem with TFileVersionInfo routines
« Reply #2 on: May 08, 2018, 09:05:16 pm »
Probably I fixed this bug in trunk. You can check this with NewPascal :

https://github.com/newpascal/newpascal/releases/latest
Checkout NewPascal initiative and donate beer - ready to use tuned FPC compiler + Lazarus for mORMot project

best regards,
Maciej Izak

ASBzone

  • Hero Member
  • *****
  • Posts: 733
  • Automation leads to relaxation...
    • Free Console Utilities for Windows (and a few for Linux) from BrainWaveCC
Re: Possible Problem with TFileVersionInfo routines
« Reply #3 on: May 09, 2018, 03:23:16 am »
Probably I fixed this bug in trunk. You can check this with NewPascal :

https://github.com/newpascal/newpascal/releases/latest

Thanks, Maciej

I will check it out and test...

Regards,
-ASB: https://www.BrainWaveCC.com/

Lazarus v4.3.0.0 (bcf314a670) / FreePascal v3.2.3-46-g77716a79dc (aka fixes)
(Windows 64-bit install w/Win32 and Linux on ARM and x64 cross-compilers via FpcUpDeluxe)

My Systems: Windows 10/11 Pro x64 (Current)

ASBzone

  • Hero Member
  • *****
  • Posts: 733
  • Automation leads to relaxation...
    • Free Console Utilities for Windows (and a few for Linux) from BrainWaveCC
Re: Possible Problem with TFileVersionInfo routines
« Reply #4 on: May 09, 2018, 06:20:38 am »
Probably I fixed this bug in trunk.

Yes, it is fixed now.  Compiled without issue, and now reads all those files that it previously choked upon.

Many thanks!!!
-ASB: https://www.BrainWaveCC.com/

Lazarus v4.3.0.0 (bcf314a670) / FreePascal v3.2.3-46-g77716a79dc (aka fixes)
(Windows 64-bit install w/Win32 and Linux on ARM and x64 cross-compilers via FpcUpDeluxe)

My Systems: Windows 10/11 Pro x64 (Current)

 

TinyPortal © 2005-2018