Forum > Linux

Bash commands to fetch "info version" included in an executable?

(1/6) > >>

devEric69:
Hello,

I want to include a FileVersion and a ProductVersion in a Linux executable (from the "Options for project" window in the Lazarus IDE).

Under MS-Windows, I can see them when I make right-click and turbo-menu "File properties" of the binary. Under Linux (Debian or Ubuntu), only the ugo rights are displayed.

Is it possible to obtain these "info version" included in the executable, under the Linux OS itself?

lucamar:
No, there's no "standard" way to read this info in Linux as in Windows. :(

Though you can easily write a "GetExeInfo" utility in (Free) Pascal by yourself.

MarkMLl:
I don't think so, at least in a formatted form. There's stuff in https://github.com/MarkMLl/Contec_cms50dplus/blob/main/common/inifilesabout.pas for doing it under program control.

readelf -n will show you some relevant stuff e.g. the build version from the linker, otherwise there might be something in objdump.

TResourceStream in the FCL should give an indication of how the resources (which includes the version info) are stored in the binary (an ELF file). But as I've said I anticipate that formatting will be a problem, and there's somewhere around zero chance of getting the developers responsible for the various desktop environments and overall distreaux to "prettify" it... Hell, if they can't agree on something useful like FatELF of a code-signing mechanism...

MarkMLl

devEric69:

--- Quote from: MarkMLl on March 09, 2021, 12:05:30 pm ---I don't think so, at least in a formatted form. There's stuff in https://github.com/MarkMLl/Contec_cms50dplus/blob/main/common/inifilesabout.pas for doing it under program control.

--- End quote ---

Thanks for the info and sharing.


--- Quote from: MarkMLl on March 09, 2021, 12:05:30 pm ---there's somewhere around zero chance of getting the developers responsible for the various desktop environments and overall distreaux to "prettify" it... Hell, if they can't agree on something useful like FatELF of a code-signing mechanism...

--- End quote ---

Indeed, I already tried with readelf: but it's still very "raw", an improved header dump like objdump does. So, I wanted to know if there was something else natively in the OS like other commands, or rather graphically, I had missed. I have my answer, now.


Otherwise, effectively it is quite simple to display this information from inside the compiled binary, in an "About" window or a command line "-h" option, from the versionresource.pp unit, ..., using TResourceStream.

Thank you for your answers.

marcov:
readelf shows toolchain info, not user version info?

Navigation

[0] Message Index

[#] Next page

Go to full version