Sign in Join

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

Mailing lists / lazarus / 2021-01

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

14 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

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

Bo Berglund

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

Reply by email

Luca Olivetti
to Bo Berglund

El 23/1/21 a les 0:18, Bo Berglund via lazarus ha escrit:

Show quoted text 13 lines
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

Reply by email

Juha Manninen
to Bo Berglund: I have a bunch of programs I have written using Lazarus (on Windows 10). I have used…

On Sat, Jan 23, 2021 at 1:18 AM Bo Berglund via lazarus <

Show quoted text 5 lines
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20210123/69b605ee/attachment.html>

Reply by email

Bo Berglund
to Bart: Assuming you have the sources, and it is a Lazarus program, then in the LFM there is a…
Bart 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

Reply by email

Bo Berglund
to Juha Manninen: On Sat, Jan 23, 2021 at 1:18 AM Bo Berglund via lazarus < How many and what kind of…
Juha Manninen wrote 11 lines
On Sat, Jan 23, 2021 at 1:18 AM Bo Berglund via lazarus < > 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

Reply by email

Bart
to Bo Berglund
PM Bo Berglund 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

Reply by email

Juha Manninen
to Bo Berglund: On Sat, 23 Jan 2021 15:28:39 +0200, Juha Manninen via lazarus It is a console program…

On Sat, Jan 23, 2021 at 4:02 PM Bo Berglund via lazarus <

Show quoted text 5 lines
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20210123/438683e0/attachment.html>

Reply by email

Luca Olivetti
to Juha Manninen: On Sat, Jan 23, 2021 at 1:18 AM Bo Berglund via lazarus < How many and what kind of…

El 23/1/21 a les 14:28, Juha Manninen via lazarus ha escrit:

Show quoted text 9 lines
On Sat, Jan 23, 2021 at 1:18 AM Bo Berglund via lazarus < <mailto:>> 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

Reply by email

Luca Olivetti
to Luca Olivetti

El 23/1/21 a les 16:40, Luca Olivetti via lazarus ha escrit:

Show quoted text 5 lines
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

Reply by email

Juha Manninen
to Luca Olivetti: El 23/1/21 a les 14:28, Juha Manninen via lazarus ha escrit: I know because I had to do…

On Sat, Jan 23, 2021 at 5:40 PM Luca Olivetti via lazarus <

Show quoted text 6 lines
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20210123/94703c81/attachment.html>

Reply by email

Unknown author
to Juha Manninen: On Sat, Jan 23, 2021 at 4:02 PM Bo Berglund via lazarus < There are no auto-upgrade…
Juha Manninen 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!*

Reply by email

Luca Olivetti
to Juha Manninen: On Sat, Jan 23, 2021 at 5:40 PM Luca Olivetti via lazarus < That is unexpected. Was it…

El 23/1/21 a les 17:03, Juha Manninen via lazarus ha escrit:

Show quoted text 13 lines
On Sat, Jan 23, 2021 at 5:40 PM Luca Olivetti via lazarus < <mailto:>> 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

Reply by email

Bo Berglund
to Luca Olivetti: El 23/1/21 a les 14:28, Juha Manninen via lazarus ha escrit: I know because I had to do…
Luca Olivetti wrote 23 lines
> 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

Reply by email