[fpc-pascal] Reading exe version info on Linux?

Reinier Olislagers reinierolislagers at gmail.com
Thu Mar 21 05:48:17 CET 2013


On 20-3-2013 21:30, Michael Van Canneyt wrote:
> On Wed, 20 Mar 2013, Reinier Olislagers wrote:
>> The program below works fine on Windows for reading e.g. info on
>> explorer.exe
>> It fails on Linux (FPC trunk x64, compiled 2013/03/14) when testing with
>> explorer.exe:
<snip>
> It should work as is;
> but can you test with strace, and see if it attempts to read the correct
> file ?

Thanks. Slightly modified test program shows
WindowsExeInfo.FileName is indeed empty :(

pascaldev at debianlaz:~$ cd /tmp
pascaldev at debianlaz:/tmp$ strace ./exeinfodemo /tmp/explorer.exe
execve("./exeinfodemo", ["./exeinfodemo", "/tmp/explorer.exe"], [/* 17
vars */]) = 0
<snip>
readlink("/proc/self/exe", "/tmp/exeinfodemo", 255) = 16
<snip timezone stuff>
access("/tmp/explorer.exe", F_OK)       = 0
write(1, "Going to read version resource f"..., 53Going to read version
resource for /tmp/explorer.exe
) = 53
access("/tmp/explorer.exe", F_OK)       = 0
write(1, "WindowsExeInfo.FileName:=\n", 26WindowsExeInfo.FileName:=
) = 26
write(1, "An unhandled exception occurred "..., 54An unhandled exception
occurred at $0000000000443657:
) = 54
write(1, "EResNotFound: Resource \"1\" not f"..., 37EResNotFound:
Resource "1" not found
) = 37
<snip>
pascaldev at debianlaz:/tmp$ ls -al /tmp/explorer.exe
-rw-r--r-- 1 pascaldev pascaldev 3079168 Mar 20 16:59 /tmp/explorer.exe



More information about the fpc-pascal mailing list