Antonio Fortuny | 2 Jan 10:06 2012
Picon

program version

Hi folks.

First of all happy new year 2012.

Lazarus provides the possibility to include the program version in the 
project options. I've the ability to extract it at runtime using the 
WIndows core functions GetFileVersionInfoSize, GetFileVersionInfo and 
VerQueryValue.
I would like to know if there is an equivalent in Linux systems.

Antonio.

--
_______________________________________________
Lazarus mailing list
Lazarus <at> lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Sven Barth | 2 Jan 10:40 2012

Re: program version

Am 02.01.2012 10:06, schrieb Antonio Fortuny:
> Hi folks.
>
> First of all happy new year 2012.
>
> Lazarus provides the possibility to include the program version in the
> project options. I've the ability to extract it at runtime using the
> WIndows core functions GetFileVersionInfoSize, GetFileVersionInfo and
> VerQueryValue.
> I would like to know if there is an equivalent in Linux systems.

The units related to the resource system are in 
$fpcdir/packages/fcl-res/src. There's also a VersionResource unit.

For an example you can look at 
$lazarusdir/examples/lazresexplorer/remainunit.pas where this is used.

I haven't tested either of them (the unit and the resource explorer), 
but they should provide you with a starting point.

Regards,
Sven

--
_______________________________________________
Lazarus mailing list
Lazarus <at> lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

(Continue reading)

michael.vancanneyt | 2 Jan 11:14 2012
Picon

Re: program version


On Mon, 2 Jan 2012, Antonio Fortuny wrote:

> Hi folks.
>
> First of all happy new year 2012.
>
> Lazarus provides the possibility to include the program version in the 
> project options. I've the ability to extract it at runtime using the WIndows 
> core functions GetFileVersionInfoSize, GetFileVersionInfo and VerQueryValue.
> I would like to know if there is an equivalent in Linux systems.
>

Yes. I use this code:

uses sysutils,resource, elfreader, versiontypes,versionresource;

Function GetProgramVersion (Out Version : String) : Boolean;

Var
   RS : TResources;
   E : TElfResourceReader;
   VR : TVersionResource;
   I : Integer;

begin
   Version:='';
   RS:=TResources.Create;
   try
     E:=TElfResourceReader.Create;
(Continue reading)

Antonio Fortuny | 2 Jan 13:45 2012
Picon

Re: program version

Thanks to you both.
Useful and it works perfecly.

Thanks again.

Antonio.

Le 02/01/2012 10:06, Antonio Fortuny a écrit :
> Hi folks.
>
> First of all happy new year 2012.
>
> Lazarus provides the possibility to include the program version in the 
> project options. I've the ability to extract it at runtime using the 
> WIndows core functions GetFileVersionInfoSize, GetFileVersionInfo and 
> VerQueryValue.
> I would like to know if there is an equivalent in Linux systems.
>
> Antonio.
>
>
>
> -- 
> _______________________________________________
> Lazarus mailing list
> Lazarus <at> lists.lazarus.freepascal.org
> http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
>

--
(Continue reading)


Gmane