[Lazarus] How to find out which version of Lazarus was used to build last?

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

[Lazarus] How to find out which version of Lazarus was used to build last?

Free Pascal - Lazarus mailing list
I have a bunch of programs I have written using Lazarus (on Windows 10).

I have used several different versions of Lazarus so the older programs are
written using an older version, and now I want to modify one of these but don't
know which version was used when I last worked on the project.
I don't want to modify too much so I would like to use the same version now...

Question:
---------
Is this information stored in any of the files in the project in a way that it
can be read by opening the file in an editor?
If so, which file?
I have looked in the lpr, lps and lpi files without success...


--
Bo Berglund
Developer in Sweden

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] How to find out which version of Lazarus was used to build last?

Free Pascal - Lazarus mailing list
El 23/1/21 a les 0:18, Bo Berglund via lazarus ha escrit:

> I have a bunch of programs I have written using Lazarus (on Windows 10).
>
> I have used several different versions of Lazarus so the older programs are
> written using an older version, and now I want to modify one of these but don't
> know which version was used when I last worked on the project.
> I don't want to modify too much so I would like to use the same version now...
>
> Question:
> ---------
> Is this information stored in any of the files in the project in a way that it
> can be read by opening the file in an editor?
> If so, which file?
> I have looked in the lpr, lps and lpi files without success...


You'll have to look for strings in the executable. Usually both the
version of FPC and of the LCL are there.

Bye
--
Luca Olivetti
Wetron Automation Technology http://www.wetron.es/
Tel. +34 93 5883004 (Ext.3010)  Fax +34 93 5883007
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] How to find out which version of Lazarus was used to build last?

Free Pascal - Lazarus mailing list
Assuming you have the sources, and it is a Lazarus program, then in
the LFM there is a string like: LCLVersion = '2.1.0.0'
That will be the last version you used to save or build the program with.

--
Bart
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] How to find out which version of Lazarus was used to build last?

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On Sat, Jan 23, 2021 at 1:18 AM Bo Berglund via lazarus <[hidden email]> wrote:
I don't want to modify too much so I would like to use the same version now...

How many and what kind of modifications are needed?
All libraries try to stay backwards compatible. As a general rule new versions are better than old versions.
I recommend you jump to the latest versions of FPC and Lazarus.

Regards,
Juha


--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] How to find out which version of Lazarus was used to build last?

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On Sat, 23 Jan 2021 13:32:29 +0100, Bart via lazarus
<[hidden email]> wrote:

>Assuming you have the sources, and it is a Lazarus program, then in
>the LFM there is a string like: LCLVersion = '2.1.0.0'
>That will be the last version you used to save or build the program with.

Well, that presupposes that it is a GUI program, which it is not.
A console program has no lfm file associated with it, I believe.


--
Bo Berglund
Developer in Sweden

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] How to find out which version of Lazarus was used to build last?

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On Sat, 23 Jan 2021 15:28:39 +0200, Juha Manninen via lazarus
<[hidden email]> wrote:

>On Sat, Jan 23, 2021 at 1:18 AM Bo Berglund via lazarus <
>[hidden email]> wrote:
>
>> I don't want to modify too much so I would like to use the same version
>> now...
>>
>
>How many and what kind of modifications are needed?
>All libraries try to stay backwards compatible. As a general rule new
>versions are better than old versions.
>I recommend you jump to the latest versions of FPC and Lazarus.

It is a console program used as a wrapper for ffmpeg use to simplify my video
handling functions.
I need it to build both on Ubuntu and Windows because I have the same tools on
both. In this case I did not modify the interface program for 2 years, but now I
need to tweak the ffmpeg call so I must open it in one of my several Lazarus
installations on Windows10. Then the same on Ubuntu.

And I do not want some auto-upgrade function launched from a newer Lazarus
destroy the sources if I need to go back to an earlier version.


--
Bo Berglund
Developer in Sweden

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] How to find out which version of Lazarus was used to build last?

Free Pascal - Lazarus mailing list
On Sat, Jan 23, 2021 at 3:02 PM Bo Berglund via lazarus
<[hidden email]> wrote:

> It is a console program used as a wrapper for ffmpeg use to simplify my video
> handling functions.

In that case I think it is not possible to determine which Lazarus IDE
version was used to compile the application.
You can retrieve the fpc version (there is a sig in the executable).

> And I do not want some auto-upgrade function launched from a newer Lazarus
> destroy the sources if I need to go back to an earlier version.

Only the LPI structure could be updated, and if your aap depends on
LazUtils, the also the code.
You can open old project in newer Lazarus and there is some setting to
save the LPI in a backwards compatible xml-format, so you can open it
eagain in the older Lazarus IDE.
If your app does NOT depend on LazUtils, then there is absolutely no
reason to open it in a recent Lazarus IDE, since then only the
compiler version matters.
(Well, in my setup I install fpc independant from Lazarus, so then
it's relatively simple).

--
Bart
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] How to find out which version of Lazarus was used to build last?

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On Sat, Jan 23, 2021 at 4:02 PM Bo Berglund via lazarus <[hidden email]> wrote:
And I do not want some auto-upgrade function launched from a newer Lazarus
destroy the sources if I need to go back to an earlier version.

There are no auto-upgrade functions. If a new library version for some reason requires a modification, it must be made manually.
Maybe I asked poorly. I meant: What modifications are needed because of updating FPC and Lazarus?
Why don't you try it?
Obviously backup your sources.

Juha


--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] How to find out which version of Lazarus was used to build last?

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
El 23/1/21 a les 14:28, Juha Manninen via lazarus ha escrit:
> On Sat, Jan 23, 2021 at 1:18 AM Bo Berglund via lazarus
> <[hidden email] <mailto:[hidden email]>>
> wrote:
>
>     I don't want to modify too much so I would like to use the same
>     version now...
>
>
> How many and what kind of modifications are needed?

I know because I had to do it recently and the answer is: a lot.
And I wasn't even using a really old version (I last modified the
program 3 years ago).
I another case, with an older program (last touched in November 2015)
where I just needed to change one line, the diff is around 11000 lines
(though many of those are just useless changes in the lfm files).


> All libraries try to stay backwards compatible. As a general rule new
> versions are better than old versions.

And introduce new bugs, change the defaults so your program no longer
works as it should, etc.
I've seen it all.

> I recommend you jump to the latest versions of FPC and Lazarus.

I try to do that, but trust me, it isn't easy.
It's not the first time I had to go back to a previous version due to
bugs (or simply different behavior) in the compiler, lcl, other
libraries, etc.

Bye
--
Luca Olivetti
Wetron Automation Technology http://www.wetron.es/
Tel. +34 93 5883004 (Ext.3010)  Fax +34 93 5883007
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] How to find out which version of Lazarus was used to build last?

Free Pascal - Lazarus mailing list
El 23/1/21 a les 16:40, Luca Olivetti via lazarus ha escrit:

>
> I try to do that, but trust me, it isn't easy.
> It's not the first time I had to go back to a previous version due to
> bugs (or simply different behavior) in the compiler, lcl, other
> libraries, etc.

And note that I'm *not* complaining.
Other, more resourceful, project fare much worse in my book (e.g. python
2 vs. python 3).

Bye
--
Luca Olivetti
Wetron Automation Technology http://www.wetron.es/
Tel. +34 93 5883004 (Ext.3010)  Fax +34 93 5883007
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] How to find out which version of Lazarus was used to build last?

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On Sat, Jan 23, 2021 at 5:40 PM Luca Olivetti via lazarus <[hidden email]> wrote:
I know because I had to do it recently and the answer is: a lot.
And I wasn't even using a really old version (I last modified the
program 3 years ago).

That is unexpected.
Was it related to the Unicode string change? Indeed it broke backwards compatibility.
If not, what required the biggest change?

Juha


--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] How to find out which version of Lazarus was used to build last?

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On 1/23/21 10:25 AM, Juha Manninen via lazarus wrote:
> Maybe I asked poorly. I meant: What modifications are needed because of updating
> FPC and Lazarus?
> Why don't you try it?
> Obviously backup your sources.

or branch the repo and see then open the sources and see what happens...


--
  NOTE: No off-list assistance is given without prior approval.
        *Please keep mailing list traffic on the list where it belongs!*
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] How to find out which version of Lazarus was used to build last?

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
El 23/1/21 a les 17:03, Juha Manninen via lazarus ha escrit:

> On Sat, Jan 23, 2021 at 5:40 PM Luca Olivetti via lazarus
> <[hidden email] <mailto:[hidden email]>>
> wrote:
>
>     I know because I had to do it recently and the answer is: a lot.
>     And I wasn't even using a really old version (I last modified the
>     program 3 years ago).
>
>
> That is unexpected.
> Was it related to the Unicode string change? Indeed it
> broke backwards compatibility.
> If not, what required the biggest change?

Yes, mostly related to the change from FileUtil to LazFileUtil due to
the relocation of UTF8* functions and the removal of UTF8ToSys and SysToUT8.
Those I found straight away since it was a compile time error.

More subtle was the change from LoadFromStream(stream) to
LoadFromStream(Stream, TEncoding.UTF8), since both variants are valid
and I didn't realize until the content of the loaded file was messed up.

All in all the unicode string change had less of an impact that I had
anticipated, still it needs a lot of testing to ensure that everything
works as before.

A more serious problem was related to an external library (zeos
database), since they changed several defaults and that broke things
until I found the workaround.

That's not a fault of the fpc/lazarus team of course, but still, if you
want to go forward, you often have to use updated versions of external
libraries, and that's something to take into account.

Sometimes, when the required change is trivial, it's just easier to use
the original compiler/lcl combo (though I still prefer to bring things
forward).

As I said, I'm not complaining, just saying what I found.

Bye
--
Luca Olivetti
Wetron Automation Technology http://www.wetron.es/
Tel. +34 93 5883004 (Ext.3010)  Fax +34 93 5883007
--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus
Reply | Threaded
Open this post in threaded view
|

Re: [Lazarus] How to find out which version of Lazarus was used to build last?

Free Pascal - Lazarus mailing list
In reply to this post by Free Pascal - Lazarus mailing list
On Sat, 23 Jan 2021 16:40:21 +0100, Luca Olivetti via lazarus
<[hidden email]> wrote:

>> How many and what kind of modifications are needed?
>
>I know because I had to do it recently and the answer is: a lot.
>And I wasn't even using a really old version (I last modified the
>program 3 years ago).
>I another case, with an older program (last touched in November 2015)
>where I just needed to change one line, the diff is around 11000 lines
>(though many of those are just useless changes in the lfm files).
>
>
>> All libraries try to stay backwards compatible. As a general rule new
>> versions are better than old versions.
>
>And introduce new bugs, change the defaults so your program no longer
>works as it should, etc.
>I've seen it all.
>
>> I recommend you jump to the latest versions of FPC and Lazarus.
>
>I try to do that, but trust me, it isn't easy.
>It's not the first time I had to go back to a previous version due to
>bugs (or simply different behavior) in the compiler, lcl, other
>libraries, etc.

Luca,
this is precisely why I asked!
Anyway, I now understand that for a GUI application, which uses forms, I can
find the Lazarus version last used by looking inside one of the lfm files last
changed.

But for the console programs this is not needed and then I could probably just
open it in any recent Lazarus since it is just the fpc that is involved here.
Lazarus just used as a manager for fpc and as an intelligent editor, right?

The current case is this helper console application, but I also have a number of
GUI applications that might need work going forward and now I know how to handle
these.

Thanks all!


--
Bo Berglund
Developer in Sweden

--
_______________________________________________
lazarus mailing list
[hidden email]
https://lists.lazarus-ide.org/listinfo/lazarus