Sign in Join

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

Mailing lists / lazarus / 2013-12

Application Information

19 messages · 6 people · –

Reply by email Subscribe to this list Your subscription

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

Hew Lines

Can anyone give me any ideas on how to access the data in the Project Application dialogue ? Specifically the Version Number. I would like to include the Version Number in both my About box as well as the Title Bar of the main form but I have been unable to figure out how to access the data stored in the Project Information dialogue.

Hew

Reply by email

Bart
to Hew Lines
Hew Lines wrote 7 lines
Can anyone give me any ideas on how to access the data in the Project Application dialogue ? Specifically the Version Number. I would like to include the Version Number in both my About box as well as the Title Bar of the main form but I have been unable to figure out how to access the data stored in the Project Information dialogue. From some project of mine.
  LazVersion := 'Lazarus '+ LCLVersion;
  FpcVersion := 'FPC ' + {$I %FPCVERSION%};

The Lazarus revision resides in ide/revision.inc, but I'm not sur eit's wise to include it in your project?

Bart

Reply by email

John Meyer
to Bart

I think we're talking about the compiled application's version number.

Bart wrote 22 lines
On 12/23/13, Hew Lines wrote: > Can anyone give me any ideas on how to access the data in the Project > Application dialogue ? Specifically the Version Number. I would like to > include the Version Number in both my About box as well as the Title Bar > of the main form but I have been unable to figure out how to access the > data stored in the Project Information dialogue. >From some project of mine. LazVersion := 'Lazarus '+ LCLVersion; FpcVersion := 'FPC ' + {$I %FPCVERSION%}; The Lazarus revision resides in ide/revision.inc, but I'm not sur eit's wise to include it in your project? Bart -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Hew Lines
to Bart: LazVersion := 'Lazarus '+ LCLVersion; FpcVersion := 'FPC ' + {$I %FPCVERSION%}; The…

Thanks Bart but that's not quite what I'm looking for. I'm looking for the version number of the compiled application. It is set in the Version Info panel of the Project Options dialogue box and auto-incremented with every build. I know that I can do it manually but am trying to see if I can simply read the auto-incremented value from the Version Info maintained by Lazarus.

Hew

Bart wrote 23 lines
On 12/23/13, Hew Lines wrote: > Can anyone give me any ideas on how to access the data in the Project > Application dialogue ? Specifically the Version Number. I would like to > include the Version Number in both my About box as well as the Title Bar > of the main form but I have been unable to figure out how to access the > data stored in the Project Information dialogue. >From some project of mine. LazVersion := 'Lazarus '+ LCLVersion; FpcVersion := 'FPC ' + {$I %FPCVERSION%}; The Lazarus revision resides in ide/revision.inc, but I'm not sur eit's wise to include it in your project? Bart -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Mark Morgan Lloyd
to Hew Lines: Thanks Bart but that's not quite what I'm looking for. I'm looking for the version number…

Apologies for reformatting the message to conform to the usual bottom-posting convention.

Hew Lines wrote 22 lines
On 2013-12-23 9:18 AM, Bart wrote: > On 12/23/13, Hew Lines wrote: > >> Can anyone give me any ideas on how to access the data in the Project >> Application dialogue ? Specifically the Version Number. I would like to >> include the Version Number in both my About box as well as the Title Bar >> of the main form but I have been unable to figure out how to access the >> data stored in the Project Information dialogue. > >From some project of mine. > > LazVersion := 'Lazarus '+ LCLVersion; > FpcVersion := 'FPC ' + {$I %FPCVERSION%}; > > The Lazarus revision resides in ide/revision.inc, but I'm not sur > eit's wise to include it in your project? Thanks Bart but that's not quite what I'm looking for. I'm looking for the version number of the compiled application. It is set in the Version Info panel of the Project Options dialogue box and auto-incremented with every build. I know that I can do it manually but am trying to see if I can simply read the auto-incremented value from the Version Info maintained by Lazarus.

I recall previous discussion of this. From what I remember you have to read resource information from the executable and that's OS-specific: I don't know whether anybody's consolidated this into a single class yet.

http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20100723/8db6b97e/attachment.ksh

That's from a thread on the 22/23rd July '10, refer to the archive for detail.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Reinier Olislagers
to Mark Morgan Lloyd
Mark Morgan Lloyd wrote 16 lines
Apologies for reformatting the message to conform to the usual bottom-posting convention. Hew Lines wrote: > On 2013-12-23 9:18 AM, Bart wrote: >> On 12/23/13, Hew Lines wrote: > I'm looking for > the version number of the compiled application. It is set in the Version > Info panel of the Project Options dialogue box and auto-incremented with > every build. I know that I can do it manually but am trying to see if I > can simply read the auto-incremented value from the Version Info > maintained by Lazarus. I recall previous discussion of this. From what I remember you have to read resource information from the executable and that's OS-specific: I don't know whether anybody's consolidated this into a single class yet.

Cross-platform; see
http://wiki.lazarus.freepascal.org/fcl-res
there's file version code in fcl-res as well.

Reply by email

Reinier Olislagers
to Reinier Olislagers
Reinier Olislagers wrote 22 lines
On 23/12/2013 20:13, Mark Morgan Lloyd wrote: > Apologies for reformatting the message to conform to the usual > bottom-posting convention. > > Hew Lines wrote: >> On 2013-12-23 9:18 AM, Bart wrote: >>> On 12/23/13, Hew Lines wrote: >> I'm looking for >> the version number of the compiled application. It is set in the Version >> Info panel of the Project Options dialogue box and auto-incremented with >> every build. I know that I can do it manually but am trying to see if I >> can simply read the auto-incremented value from the Version Info >> maintained by Lazarus. > > I recall previous discussion of this. From what I remember you have to > read resource information from the executable and that's OS-specific: I > don't know whether anybody's consolidated this into a single class yet. Cross-platform; see http://wiki.lazarus.freepascal.org/fcl-res there's file version code in fcl-res as well.

And
http://wiki.lazarus.freepascal.org/User_Changes_Trunk#TVersionInfo_.28fileinfo_unit.29_re-implemented_in_a_platform_independent_way

no idea whether this has been backported to FPC 2.6.2/4...

Reply by email

Hew Lines
to Anthony Tekatch: I have used vinfo like described here: Topic: Get and use the Build Number within your…

Many thanks Anthony. Looks like exactly what I was looking for.

Hew

Anthony Tekatch wrote 13 lines
I have used vinfo like described here: Topic: Get and use the Build Number within your program http://forum.lazarus.freepascal.org/index.php?topic=12435.0 And, this vinfo inspired rework might also help: Topic: Accessing build info and compiler info in Source http://forum.lazarus.freepascal.org/index.php?topic=13957.0 -- _______________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Hew Lines
to Mark Morgan Lloyd: Apologies for reformatting the message to conform to the usual bottom-posting convention.…
Mark Morgan Lloyd wrote 42 lines
Apologies for reformatting the message to conform to the usual bottom-posting convention. Hew Lines wrote: > On 2013-12-23 9:18 AM, Bart wrote: >> On 12/23/13, Hew Lines wrote: >> >>> Can anyone give me any ideas on how to access the data in the Project >>> Application dialogue ? Specifically the Version Number. I would >>> like to >>> include the Version Number in both my About box as well as the >>> Title Bar >>> of the main form but I have been unable to figure out how to access >>> the >>> data stored in the Project Information dialogue. >> >From some project of mine. >> >> LazVersion := 'Lazarus '+ LCLVersion; >> FpcVersion := 'FPC ' + {$I %FPCVERSION%}; >> >> The Lazarus revision resides in ide/revision.inc, but I'm not sur >> eit's wise to include it in your project? > > Thanks Bart but that's not quite what I'm looking for. I'm looking for > the version number of the compiled application. It is set in the Version > Info panel of the Project Options dialogue box and auto-incremented with > every build. I know that I can do it manually but am trying to see if I > can simply read the auto-incremented value from the Version Info > maintained by Lazarus. I recall previous discussion of this. From what I remember you have to read resource information from the executable and that's OS-specific: I don't know whether anybody's consolidated this into a single class yet. http://lists.lazarus.freepascal.org/pipermail/lazarus/attachments/20100723/8db6b97e/attachment.ksh That's from a thread on the 22/23rd July '10, refer to the archive for detail.

Thanks Mark. Looks like exactly what I was looking for.

Hew

Reply by email

Hew Lines
to Reinier Olislagers: And http://wiki.lazarus.freepascal.org/User_Changes_Trunk#TVersionInfo_.28fileinfo_unit.29…
Reinier Olislagers wrote 28 lines
On 23/12/2013 20:16, Reinier Olislagers wrote: > On 23/12/2013 20:13, Mark Morgan Lloyd wrote: >> Apologies for reformatting the message to conform to the usual >> bottom-posting convention. >> >> Hew Lines wrote: >>> On 2013-12-23 9:18 AM, Bart wrote: >>>> On 12/23/13, Hew Lines wrote: >>> I'm looking for >>> the version number of the compiled application. It is set in the Version >>> Info panel of the Project Options dialogue box and auto-incremented with >>> every build. I know that I can do it manually but am trying to see if I >>> can simply read the auto-incremented value from the Version Info >>> maintained by Lazarus. >> I recall previous discussion of this. From what I remember you have to >> read resource information from the executable and that's OS-specific: I >> don't know whether anybody's consolidated this into a single class yet. > Cross-platform; see > http://wiki.lazarus.freepascal.org/fcl-res > there's file version code in fcl-res as well. > And http://wiki.lazarus.freepascal.org/User_Changes_Trunk#TVersionInfo_.28fileinfo_unit.29_re-implemented_in_a_platform_independent_way no idea whether this has been backported to FPC 2.6.2/4... -- _______

Thanks Reinier. Greatly appreciated.

Hew

Show quoted text 5 lines
________________________________________ Lazarus mailing list http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Mark Morgan Lloyd
to Reinier Olislagers: Cross-platform; see http://wiki.lazarus.freepascal.org/fcl-res there's file version code…
Reinier Olislagers wrote 20 lines
On 23/12/2013 20:13, Mark Morgan Lloyd wrote: > Apologies for reformatting the message to conform to the usual > bottom-posting convention. > > Hew Lines wrote: >> On 2013-12-23 9:18 AM, Bart wrote: >>> On 12/23/13, Hew Lines wrote: >> I'm looking for >> the version number of the compiled application. It is set in the Version >> Info panel of the Project Options dialogue box and auto-incremented with >> every build. I know that I can do it manually but am trying to see if I >> can simply read the auto-incremented value from the Version Info >> maintained by Lazarus. > I recall previous discussion of this. From what I remember you have to > read resource information from the executable and that's OS-specific: I > don't know whether anybody's consolidated this into a single class yet. Cross-platform; see http://wiki.lazarus.freepascal.org/fcl-res there's file version code in fcl-res as well.

I don't think there's a well-named Wiki page for this, which is a bit of an FAQ. As an interim measure, should I add an "Other platforms" section to
http://wiki.lazarus.freepascal.org/Mac_Show_Application_Title,_Version,_and_Company with the links that people have just contributed?

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Reinier Olislagers
to Mark Morgan Lloyd
Mark Morgan Lloyd wrote 12 lines
Reinier Olislagers wrote: > On 23/12/2013 20:13, Mark Morgan Lloyd wrote: > Cross-platform; see > http://wiki.lazarus.freepascal.org/fcl-res > there's file version code in fcl-res as well. I don't think there's a well-named Wiki page for this, which is a bit of an FAQ. As an interim measure, should I add an "Other platforms" section to http://wiki.lazarus.freepascal.org/Mac_Show_Application_Title,_Version,_and_Company with the links that people have just contributed?

1. Good idea to post the links on the wiki, thanks, but:
2. Why not just create a page called File Version Information (or a much better name, sorry, no coffee yet), and link to that? That'll at least get it out of the OSX sphere...

Reply by email

Mark Morgan Lloyd
to Reinier Olislagers
Reinier Olislagers wrote 17 lines
On 25/12/2013 20:16, Mark Morgan Lloyd wrote: > Reinier Olislagers wrote: >> On 23/12/2013 20:13, Mark Morgan Lloyd wrote: >> Cross-platform; see >> http://wiki.lazarus.freepascal.org/fcl-res >> there's file version code in fcl-res as well. > I don't think there's a well-named Wiki page for this, which is a bit of > an FAQ. As an interim measure, should I add an "Other platforms" section > to > http://wiki.lazarus.freepascal.org/Mac_Show_Application_Title,_Version,_and_Company > with the links that people have just contributed? > 1. Good idea to post the links on the wiki, thanks, but: 2. Why not just create a page called File Version Information (or a much better name, sorry, no coffee yet), and link to that? That'll at least get it out of the OSX sphere...

I don't pretend to understand all the cross-platform issues and I was trying to avoid work :-)

OK, I'll do a very basic page "Show Application Title, Version, and Company" i.e. similar to the existing one that somebody's filled with code- I don't want to mess around with that until we know where it came from.

Somebody was asking about getting version info into the final (i.e. executable) filename. I've put date info into filenames on Linux using Compilation -> Execute After -> Command (with mv, `date` and so on) but if access to the IDE-generated version info is now settling down presumably it wouldn't be too difficult to read it out as the final stage of the build process- even if this takes a separate 'brand' program.

I suppose the next question is going to be how to sign an executable so that collaborating programs can check each others' authenticity. I believe that ELF doesn't have provision in the header for anything like that, but presumably it could be stuck into the resource info e.g. in the FileDescription field.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Reinier Olislagers
to Mark Morgan Lloyd
Mark Morgan Lloyd wrote
Reinier Olislagers wrote: > On 25/12/2013 20:16, Mark Morgan Lloyd wrote: I don't pretend to understand all the cross-platform issues and I was trying to avoid work :-)

Very understandable ;)

In the end, any contribution is better than none - people knowledgeable about other platforms can always contribute about theirs. At least the trunk resource units I linked to are cross-platform, so that shouldn't be a problem.

And as usual, I'd be happy to to demolish^H^H^H^H go over the page you created and update what I can...

Show quoted text 11 lines
OK, I'll do a very basic page "Show Application Title, Version, and Company" i.e. similar to the existing one that somebody's filled with code- I don't want to mess around with that until we know where it came from. Somebody was asking about getting version info into the final (i.e. executable) filename. I've put date info into filenames on Linux using Compilation -> Execute After -> Command (with mv, `date` and so on) but if access to the IDE-generated version info is now settling down presumably it wouldn't be too difficult to read it out as the final stage of the build process- even if this takes a separate 'brand' program.

Could be. Haven't looked at file version info etc lately.

Show quoted text 5 lines
I suppose the next question is going to be how to sign an executable so that collaborating programs can check each others' authenticity. I believe that ELF doesn't have provision in the header for anything like that, but presumably it could be stuck into the resource info e.g. in the FileDescription field.

Or a separate resource actually. I presume that's how it done on Windows, OSX too.
Don't know if there are any initiatives about that in the Linux world...

Reply by email

Mark Morgan Lloyd
to Reinier Olislagers
Reinier Olislagers wrote 6 lines
On 26/12/2013 09:26, Mark Morgan Lloyd wrote: > Reinier Olislagers wrote: >> On 25/12/2013 20:16, Mark Morgan Lloyd wrote: > I don't pretend to understand all the cross-platform issues and I was > trying to avoid work :-) Very understandable ;)

There'll be something there in a few minutes. After that I'm trying to get my teeth into transcribing http://retro-b5500.blogspot.co.uk/ from the original Klingon into Pascal.

Show quoted text 7 lines
In the end, any contribution is better than none - people knowledgeable about other platforms can always contribute about theirs. At least the trunk resource units I linked to are cross-platform, so that shouldn't be a problem. And as usual, I'd be happy to to demolish^H^H^H^H go over the page you created and update what I can...

I don't think there's much urgency once it shows up in the Wiki search results, except for deleting (or at least marking as deprecated) anything that you know is obsolete.

Show quoted text 12 lines
> OK, I'll do a very basic page "Show Application Title, Version, and > Company" i.e. similar to the existing one that somebody's filled with > code- I don't want to mess around with that until we know where it came > from. > > Somebody was asking about getting version info into the final (i.e. > executable) filename. I've put date info into filenames on Linux using > Compilation -> Execute After -> Command (with mv, `date` and so on) but > if access to the IDE-generated version info is now settling down > presumably it wouldn't be too difficult to read it out as the final > stage of the build process- even if this takes a separate 'brand' program. Could be. Haven't looked at file version info etc lately.

I'll append a couple of hacks that I find useful. They're better in the Wiki than discussed in email etc. since they rely on accurate backticks and quoting.

Show quoted text 8 lines
> I suppose the next question is going to be how to sign an executable so > that collaborating programs can check each others' authenticity. I > believe that ELF doesn't have provision in the header for anything like > that, but presumably it could be stuck into the resource info e.g. in > the FileDescription field. Or a separate resource actually. I presume that's how it done on Windows, OSX too. Don't know if there are any initiatives about that in the Linux world...

Not as far as I know. But I'm very slowly trying to put together something collaborative, and it would be a useful feature if programs working at different levels (i.e. at different places relative to a tree of database servers) could validate each other to ensure that nobody had inserted code to spoof a logon.

If something (an IDE plugin?) inserted two hashes (one plain, the other salted) then it would be possible both to validate that code hadn't been corrupted in transit and that it hadn't been built by somebody unauthorised.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Reinier Olislagers
to Mark Morgan Lloyd
Mark Morgan Lloyd wrote 7 lines
Reinier Olislagers wrote: > On 26/12/2013 09:26, Mark Morgan Lloyd wrote: >> Reinier Olislagers wrote: >> OK, I'll do a very basic page "Show Application Title, Version, and >> Company" i.e. similar to the existing one that somebody's filled with >> code- I don't want to mess around with that until we know where it came >> from.

Updated the page. Includes working FPC 2.7.1 code for
- (all) Windows exes
- Lazarus-compiled ELF executables on Linux.
Not yet tested on OSX; if anybody does, please update the wiki page, thanks.

I'll append a couple of hacks that I find useful. They're better in the Wiki than discussed in email etc. since they rely on accurate backticks and quoting.

Added a cross-platform revision2inc solution :)

Reply by email

Mark Morgan Lloyd
to Reinier Olislagers
Reinier Olislagers wrote 11 lines
On 26/12/2013 10:11, Mark Morgan Lloyd wrote: > Reinier Olislagers wrote: >> On 26/12/2013 09:26, Mark Morgan Lloyd wrote: >>> Reinier Olislagers wrote: >>> OK, I'll do a very basic page "Show Application Title, Version, and >>> Company" i.e. similar to the existing one that somebody's filled with >>> code- I don't want to mess around with that until we know where it came >>> from. Updated the page. Includes working FPC 2.7.1 code for - (all) Windows exes - Lazarus-compiled ELF executables on Linux.

Definitely benefited from the attention of somebody who knew what he was doing :-)

I think the first example has lost its bit about being based on fcl-res, or is that intentional because of the difference between 2.6 and 2.7?

Not yet tested on OSX; if anybody does, please update the wiki page, thanks.

I'm hoping to find time to look at PPC OSX, but that will mean getting to grips with finding the Mac development stuff. Maybe next year...

> I'll append a couple of hacks that I find useful. They're better in the > Wiki than discussed in email etc. since they rely on accurate backticks > and quoting. Added a cross-platform revision2inc solution :)

There was some reason I didn't use that. I can't remember the detail, but I think it didn't build on Solaris or something similarly odd.

Mark Morgan Lloyd markMLl .AT. telemetry.co .DOT. uk [Opinions above are the author's, not those of his employers or colleagues]

Reply by email

Reinier Olislagers
to Mark Morgan Lloyd
Mark Morgan Lloyd wrote 7 lines
Reinier Olislagers wrote: > On 26/12/2013 10:11, Mark Morgan Lloyd wrote: >> Reinier Olislagers wrote: >>> On 26/12/2013 09:26, Mark Morgan Lloyd wrote: >>>> Reinier Olislagers wrote: I think the first example has lost its bit about being based on fcl-res, or is that intentional because of the difference between 2.6 and 2.7?

Looking at the code, I suppose it does use fcl-res, yes, added it back in.

Show quoted text 5 lines
> Not yet tested on OSX; if anybody does, please update the wiki page, > thanks. I'm hoping to find time to look at PPC OSX, but that will mean getting to grips with finding the Mac development stuff. Maybe next year...

The armchair theorists are too busy theorizing I suppose ;)... so I tested it myself (OSX Intel, FPC trunk); works; updated OSX part. Removed misleading remark inserted by somebody else about having to use plists.

> Added a cross-platform revision2inc solution :) There was some reason I didn't use that. I can't remember the detail, but I think it didn't build on Solaris or something similarly odd.

Yes, that's very well possible.

Reply by email