In Windows there is a version information page in an executable/library file properties window. How to view that info in Ubuntu?
In Windows there is a version information page in an executable/library file properties window. How to view that info in Ubuntu?
I'm working in a tool called pev to retrieve information about PE files on the command line.
It is installable with
The file version can be fetched with
From the
gnome-exe-thumbnailer
script, suggested by Scott Ritchie:extracts the version information, printing some binary data mixed with UTF-16 text. The script converts it to readable text by piping it through:
The overall command is then
wrestool --extract --raw --type=version inputfile.exe | tr '\0, ' '\t.\0' | sed 's/\t\t/_/g' | tr -c -d '[:print:]' | sed -r -n 's/.*Version[^0-9]*([0-9]+\.[0-9]+(\.[0-9][0-9]?)?).*/\1/p'
.As an alternative to using tr and sed to parse the output from @mechanical-snail 's solution, here is a GNU strings and GNU grep version:
UPDATE:
Another alternative is a recent version of exiftool by Phil Harvey (it is based on perl, easy to install with
sudo apt-get install libimage-exiftool-perl
, also available for Mac and Windows). It has lots of formatting options.If you install the
gnome-exe-thumbnailer
package, you can simply look at the version number innautilus
,caja
,nemo
andthunar
.The code to do this manually is available in
/usr/bin/gnome-exe-thumbnailer.sh
For the sake of completeness, here's something you can do if you can't install new applications, but you do have p7zip and Vim:
7z x whatever.exe .rsrc/VERSION/1
.rsrc/VERSION/1
file in Vim:e ++enc=utf16le
at the Vim command line to request that the file's contents be reinterpreted as little-endian UTF-16.The method mentioned in @ssokolow's answer does not work exactly for me.
However, the
7z
's (version 16.02 or above) "list" option will list that information already.So, I defined the following Bash function:
You can put this function in your
.bash_aliases
file and use like this:I just found out myself how to create a nice python dict with the information (I was looking around myself and wound up here for some reason) and would like to present my method here:
Github Gists - spookyahell/exe2version_info.py
I am licensing it under the MIT License... may anybody who feels the need to create useful scripts or other things with it...
And see Github Gists - spookyahell/peinfo.py for an example implementation of this method in another script...