Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2008-11

Version information under Linux

13 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Graeme Geldenhuys

Hi

Does the "Project Options | Version Information" have any affect under Linux? I noticed it created a <projectname>.rc file, but does it actually include something in the Elf executable or anywhere else for that matter? Can the desktop environment check it, or the application itself at runtime etc..?

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Graeme Geldenhuys
to Graeme Geldenhuys
Graeme Geldenhuys wrote 7 lines
Hi Does the "Project Options | Version Information" have any affect under Linux? I noticed it created a <projectname>.rc file, but does it actually include something in the Elf executable or anywhere else for that matter? Can the desktop environment check it, or the application itself at runtime etc..?

The reason I ask, is because the wiki conveniently ignored that tabs help in the IDE help page.

http://wiki.lazarus.freepascal.org/IDE_Window:_Project_Options

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Graeme Geldenhuys
to Torsten Bonde Christiansen

2009/6/4 Torsten Bonde Christiansen :

Did anyone find an answer for this? I'm interested because I would like to extract the version information at runtime in both linux and in windows?

So would I, but nobody responded yet.

Also, if the ELF format doesn't support version information, then shouldn't the Version Info tab in Lazarus IDE be disabled for Linux, BSD platforms. There is no point in giving the developer false hope by filling in that information, but nothing is inserted in the executable.

As for extracting the version information from the executable under Windows and Linux.
I thought of writing some wrapper function for this. Under Windows that function will use the Windows API, and under Linux it will use '<executable> --version' and read back the result. Even though you create a Linux GUI application, under linux the stdout is always available, so it should work (I think).

The other question I have, is the application icon. Does the ELF format support a built-in application icon? Can Gnome or KDE see that icon inside the executable (like Windows does) when you create a desktop shortcut, or must you always use and external icon image file.

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Michael Van Canneyt
to Graeme Geldenhuys
Graeme Geldenhuys wrote 12 lines
2009/6/4 Torsten Bonde Christiansen : > > Did anyone find an answer for this? I'm interested because I would like to > extract the version information at runtime in both linux and in windows? So would I, but nobody responded yet. Also, if the ELF format doesn't support version information, then shouldn't the Version Info tab in Lazarus IDE be disabled for Linux, BSD platforms. There is no point in giving the developer false hope by filling in that information, but nothing is inserted in the executable.

Version 2.3.1 of the compiler supports all this on linux.

Michael.

Reply by email

Vincent Snijders
to Graeme Geldenhuys: 2009/6/4 Torsten Bonde Christiansen : So would I, but nobody responded yet. Also, if the…
Graeme Geldenhuys wrote 12 lines
2009/6/4 Torsten Bonde Christiansen : > Did anyone find an answer for this? I'm interested because I would like to > extract the version information at runtime in both linux and in windows? So would I, but nobody responded yet. Also, if the ELF format doesn't support version information, then shouldn't the Version Info tab in Lazarus IDE be disabled for Linux, BSD platforms. There is no point in giving the developer false hope by filling in that information, but nothing is inserted in the executable.

It should not be disabled. Project options don't depend on the current target OS, so if you current target OS doesn't mean you are not allowed to set the version number, because later you (or somebody else) may decide to compile the application for windows. The manifest option and the application bundle option are not disabled either on linux.

Vincent

Reply by email

Michael Van Canneyt
to Torsten Bonde Christiansen
Torsten Bonde Christiansen wrote
Michael Van Canneyt wrote: > > Version 2.3.1 of the compiler supports all this on linux. If the compiler supports it, how can the information be extracted at runtime?

There are calls in the system unit to get the resource data; I have not yet documented them.

Look for FindResource, FIndResourceEx etc. in rtl/inc/sysres.inc

Michael.

Reply by email

Graeme Geldenhuys
to Michael Van Canneyt

2009/6/4 Michael Van Canneyt :

Show quoted text 5 lines
There are calls in the system unit to get the resource data; I have not yet documented them. Look for FindResource, FIndResourceEx etc. in rtl/inc/sysres.inc

Excellent news. Thanks Michael.

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Graeme Geldenhuys
to Vincent Snijders: It should not be disabled. Project options don't depend on the current target OS, so if…

2009/6/4 Vincent Snijders :

compile the application for windows. The manifest option and the application bundle option are not disabled either on linux.

Point taken. I can see how this could be useful for multi-platform projects.

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Torsten Bonde Christiansen
to Michael Van Canneyt: There are calls in the system unit to get the resource data; I have not yet documented…
Michael Van Canneyt wrote 5 lines
There are calls in the system unit to get the resource data; I have not yet documented them. Look for FindResource, FIndResourceEx etc. in rtl/inc/sysres.inc

Is it correct that these are not implemented yet (along with no documentation)?

All functions in the resourcemanager seems to return 0 (nul). I'm using revision 13233 from the fpc trunk repository.

Regards,
Torsten Bonde Christiansen.

Reply by email

shoKwave
to Torsten Bonde Christiansen: If the compiler supports it, how can the information be extracted at runtime? Torsten…
Show quoted text 14 lines
Michael Van Canneyt wrote: > > Version 2.3.1 of the compiler supports all this on linux. If the compiler supports it, how can the information be extracted at runtime? Regards, Torsten Bonde Christiansen. _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
uses FileInfo;
var info:TFileVersionInfo;
begin
  info := TFileVersionInfo.Create(nil);
  info.fileName:=Application.Params[0];
  showmessage(info.VersionStrings.Text);
end;

Works for me under Windows.

Regards,
Ingo

Reply by email

Vincent Snijders
to Torsten Bonde Christiansen: Is it correct that these are not implemented yet (along with no documentation)? All…
Torsten Bonde Christiansen wrote 9 lines
Michael Van Canneyt wrote: > > There are calls in the system unit to get the resource data; I have > not yet documented them. > > Look for FindResource, FIndResourceEx etc. in rtl/inc/sysres.inc Is it correct that these are not implemented yet (along with no documentation)?

Note that the Lazarus IDE does not pass this information to the compiler, if the target is not win32 (or win64?). You would have to do that yourself.

All functions in the resourcemanager seems to return 0 (nul). I'm using revision 13233 from the fpc trunk repository.

Vincent

Reply by email