<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 06.11.2013 15:39, Antonio Fortuny
wrote:<br>
</div>
<blockquote cite="mid:l5dd9p$s2p$1@ger.gmane.org" type="cite">Hi
Folks.
<br>
<br>
Currently I can extract any Windows program version as far as it
has been compilerd on a Win platform using either Delphi or
Lazarus.
<br>
I can do the same on a Linux program on a Linux platform as fas as
far as the version has been embedde somewhere in the elf.
<br>
So fa, so good.
<br>
But do you now any method for a program running on a Linux
platform to extract the version of a Window compiled program ? And
vice-versa ?
<br>
Al I know about this is that the version is embedded somwhere
into a resource into the executable
<br>
Is it right if I assume that executable program signatures are
<br>
Windows: first two bytes of the file are "MZ".
<br>
Linux: first 4 bytes of the file are $7F'ELF'
<br>
<br>
Antonio
<br>
<br>
<br>
<br>
--
<br>
_______________________________________________
<br>
Lazarus mailing list
<br>
<a class="moz-txt-link-abbreviated" href="mailto:Lazarus@lists.lazarus.freepascal.org">Lazarus@lists.lazarus.freepascal.org</a>
<br>
<a class="moz-txt-link-freetext" href="http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus">http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus</a>
<br>
</blockquote>
<br>
<font face="Liberation Sans">The unit versionresource</font> is part
of package fcl-res <br>
<br>
Unit allow x-platform version resource extraction and parsing.<br>
rsrc:=TVersionResource.Create;<br>
Stream := TResourceStream.CreateFromID(hMod, 1, PChar(RT_VERSION));<br>
rsrc.SetCustomRawDataStream(Stream);<br>
with res do<br>
case it of<br>
vsFileVersion:<br>
Result:=format('%d.%d.%d.%d',[FileVersion[0],FileVersion[1],FileVersion[2],FileVersion[3]]);<br>
vsProductVersion:<br>
Result:=format('%d.%d.%d.%d',[ProductVersion[0],ProductVersion[1],ProductVersion[2],ProductVersion[3]]);<br>
end;<br>
<br>
regards,<br>
Anton<br>
</body>
</html>