[Lazarus] Program version
Anton Kavalenka
anton.k at tut.by
Wed Nov 6 14:41:07 CET 2013
On 06.11.2013 15:39, Antonio Fortuny wrote:
> Hi Folks.
>
> Currently I can extract any Windows program version as far as it has
> been compilerd on a Win platform using either Delphi or Lazarus.
> 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.
> So fa, so good.
> 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 ?
> Al I know about this is that the version is embedded somwhere into a
> resource into the executable
> Is it right if I assume that executable program signatures are
> Windows: first two bytes of the file are "MZ".
> Linux: first 4 bytes of the file are $7F'ELF'
>
> Antonio
>
>
>
> --
> _______________________________________________
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
The unit versionresource is part of package fcl-res
Unit allow x-platform version resource extraction and parsing.
rsrc:=TVersionResource.Create;
Stream := TResourceStream.CreateFromID(hMod, 1, PChar(RT_VERSION));
rsrc.SetCustomRawDataStream(Stream);
with res do
case it of
vsFileVersion:
Result:=format('%d.%d.%d.%d',[FileVersion[0],FileVersion[1],FileVersion[2],FileVersion[3]]);
vsProductVersion:
Result:=format('%d.%d.%d.%d',[ProductVersion[0],ProductVersion[1],ProductVersion[2],ProductVersion[3]]);
end;
regards,
Anton
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20131106/115c4dae/attachment-0003.html>
More information about the Lazarus
mailing list