Interesting way to extract a Windows exe file version from Linux
[email protected] (ToddAndMargo via perl6-users) Sun, 12 Oct 2025 00:49:30 -0700
| Newsgroups | perl.perl6.users |
|---|---|
| Message-ID | <[email protected]> |
Hi All,
I thought this would be fun. Some web site make it really
annoying to find a download file's version with all the JS
code they call, which cURL does not read.
-T
Raku: extract Windows exe file version from Linux:
Note: the exe file must be set up properly with
"VS_FIXEDFILEINFO structure" for this to give
a correct answer
The file version is the line directly after the line
with "FileVersion" on it
$ strings -e l AnyDesk-9.6.2.exe | raku -e 'my Str $x=slurp();
$x~~s:i/.*? "FileVersion" //; say $x.lines[1];'
9.6.2
$ strings -e l ShutUp11-1.9.1444.exe | raku -e 'my Str $x=slurp();
$x~~s:i/.*? "FileVersion" //; say $x.lines[1];'
1.9.1444.426
$ strings -e l Icedrive-3.52.exe | raku -e 'my Str $x=slurp();
$x~~s:i/.*? "FileVersion" //; say $x.lines[1];'
3.5.2.152