Recent

Author Topic: 2ndary install (follow up to 2.0.0 release thread)  (Read 1917 times)

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 5711
    • wiki
2ndary install (follow up to 2.0.0 release thread)
« on: February 07, 2019, 09:45:18 pm »
I did a side-by-side 32-bit install to 1.8.4 on Win10-64, so got the dialog for config file version conflict and to use the --pcp option for having 2 installs, which I did using the Windows-R Run dialog. After doing this Laz2 does not remember this was set on the previous run and to use the new config directory when it starts. I had to manually edit the startup shortcut to use the option on each invoke.

Also, it would be nice if the installer asked which top menu name/shortcut name prefix should be used when a previous installation is detected but not being upgraded and overwritten, so the shortcuts and menus from existing version aren't affected.

The installer really only supports shortcuts/menu for one install, since (afaik) all shortcuts have the same name. (Of course once you renamend them, it should be fine.

You should NOT need to edit the properties of the shortcut(s) to add pcp.

If you click on "secondary install" you will be ask for a config dir. This config dir is stored inside the lazarus dir, in a file called lazarus.cfg.

Secondary install applies to same version numbers, i.e. 2.0 release and 2.0 fixes; installer was complaining "base version not found" or some such when I tried that option.
"secondary install" should work for any version, bitness, ....; entirely independent of any other install. Even if there is no other install.
That is provided, that you provide a new unique config dir for each 2ndary install.

A lazarus installation should only look at the following data
- Its install dir
- Its congig, according to --pcp
- open project/files

So a 2ndary install, with its own -pcp should never be aware of any other primary or 2ndary install.

The installer keeps a few registry entries, associating files, and listing Lazarus in installed software.




I was unable to find that error in the Lazarus directory. When exactly did you get it. (start/end of installer? starting lazarus? ...)
How to reproduce. Which installer did you download and use to get it?

Quote
This "lazarus.cfg" file is not mentioned as what is checked for in addition to the default dir, or its format if someone wants create or edit it manually, that I've seen in the docs. The --pcp option doesn't create it either, apparently only the installer does. It also does not have a location entry in Options/Environment/Files dialog pane, so side-by-sides of the same version can share a config file if they want, for this .cfg or the config file itself directly.
http://wiki.lazarus.freepascal.org/Multiple_Lazarus#Using_lazarus.cfg_file
Its content (except for comments) is appended to (or replaces) the command line options.
So you can put any argument that the IDE would accept as command line param. (One per line)

If you run lazarus.exe or startlazarus, it looks in the same path as the exe is located. This should be your installation folder.

The "lazarus.cfg" file is seen as part of the installation, and not as config.
Normally (if not specially requested by the user) there is on config in the installation folder. Because on a multi user OS the installation folder could be write protected to the user that runs the IDE.
As such the "lazarus.cfg" file can not be shared between installs.

It being considered as part of the installation, is also the reason why it is intentonally not accesible through the options (or any other part of the IDE).



Btw installers. The add-on (cross compile) installers currently warn that the directory is not empty. Well it should not be empty.... ;)
One day that will get fixed. But for now there is much else to do.


Quote
Yes, the menu shortcuts can have the same name, if the menu directory they're part of is named differently. I think (haven't looked at them in detail recently) menu directory name is static strings in .ist files, not variables like install dir. Desktop shortcuts could be handled similarly, afaik.
The installer does afaik/iirc not have any provisions for the shortcuts for 2ndary installs.

This is considered a missing feature. Currently there is no one assigned to work on it. Patches are of course welcome. (split the issues into small enough sub issues, so patches are esay to review).

Same goes for file associations. In theory the context menu could list each 2ndary install in the "Open with" section of a pas, pp, lpi, lpr, ... file.

Quote
Given for fresh installs these gotchas don't apply these comments are nits, not bug reports, but would enhance the OOBE for other users of the current version, I imagine, that like me want to test things in the new one for unknown regressions with their own code.

As I see, I don't know how exatly you got to get the issues. (they may well be present, the config/install system is complex, and the installer currently not really maintained (lack of menpower).

The config is not meant to be shared between two installations, even if the are identical versions.
The IDE writes the exact path and filename of the lazarus.exe into one of the option files (IIRC environmentoptions.xml).
If this path/name changes, then the IDE warns. You can ignore this, and it may be ok. Or you can update it, and get the warning when you open the IDE from the first location again.

If 2 IDE "sharing" a config, and they differ (eg in packages installed) then that may cause issues. (maybe). At least there is no work done (nor planed, nor will be) to make such shared usage possible.
Also no idea what happens if 2 IDE are open, and one changes the shared options. The other may not see those changes, and undo them. Or anything may happen.

If you have special scenarious, what you want to archive, then give details on them.

« Last Edit: February 07, 2019, 09:52:28 pm by Martin_fr »

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 5711
    • wiki
Re: 2ndary install (follow up to 2.0.0 release thread)
« Reply #1 on: February 07, 2019, 10:01:26 pm »
I did a side-by-side 32-bit install to 1.8.4 on Win10-64, so got the dialog for config file version conflict and to use the --pcp option for having 2 installs, which I did using the Windows-R Run dialog. After doing this Laz2 does not remember this was set on the previous run and to use the new config directory when it starts. I had to manually edit the startup shortcut to use the option on each invoke.
That would be normal.

The IDE (like most programs?) does act according to the command line params it is given. But it does not store them. They have to be give on each and every run. So for this you would have to edit each and every shortcut (menu, desktop, ...)

More to the point, the IDE may not even be able to store the --pcp param for future use.

It obviously can not store it into the config folder. Since next time it is opened, it would only know that config folder *after* it retrieved the info.

The only place the IDE knows, before getting its config folder is the directory from which it is run (the install dir). But the install dir may not be writeable if the IDE is started by a normal user.

Maybe the text in the dialog can be improved. Feel free to make suggestions



Also different users may use the IDE from the same install dir, and each specify their own --pcp on the command line (usually not needed, because the pcp is in each users %appdir%) / though that would also conflict with 2ndary lazarus.cfg.
2ndary installs are kind of limited to individual users.
« Last Edit: February 07, 2019, 10:04:48 pm by Martin_fr »

MarkZ

  • Newbie
  • Posts: 3
Re: 2ndary install (follow up to 2.0.0 release thread)
« Reply #2 on: February 08, 2019, 11:08:27 pm »
I believe including that link, "http://wiki.lazarus.freepascal.org/Multiple_Lazarus#Using_lazarus.cfg_file", rather than saying "use --pcp", in the dialog would be more helpful.

I agree with you the install / config / startup process is too convoluted to mess with gratuitously :) I'm more an end user, and haven't tried too hard to make sense of that process. Some of that comes from fpc, some from what mattias and vincent were able to get to work, it looks from the svn log. You've been one of the maintainers of tools/install for only 6+ years now, according to that, so you've inherited much of this. However, for another example of how multiple versions and configs can be handled there's the JRE/JDK manager for Java, in terms of basic design... I've had 1.7, 1.8 and 1.9 betas of both side-by-side because various applications were reliable only with particular versions. Implementing the OLE interfaces to the shell and registry isn't trivial, for switching between versions as default configuration, but the Java control panel applet shows it is possible.

As to separate shortcuts for secondary installs, that's a relatively minor addition to lazarus.iss and secondary.pas, near as I can tell. I checked, the relevant values are static coded currently in the [Icons] section of lazarus.iss. I'm not familiar enough with the Inno system to write patches for what's there, though, just see where they might go.

Re: "I was unable to find that error in the Lazarus directory. When exactly did you get it. (start/end of installer? starting lazarus? ...)
How to reproduce. Which installer did you download and use to get it?"

It's the installer from release/win 32 bit/Laz 2.0; I didn't try the RCs. I forget the exact message, sorry, and why I said "some such", but the indication was it would invalidate using 1.8.4 so I cancelled out. This was before the start of unpacking new files, anyways. Perhaps it was a warning that current config files would be automatically upgraded, per "The config directory can not be shared between different Lazarus versions. A newer Lazarus can read older configs and will update them automatically. There is no guarantee that an older version can read config files of a newer version." from that page. I'd need a fresh machine to duplicate the scenario. Running it now finds the new version, so functions more as expected.

Re: "If 2 IDE "sharing" a config, and they differ (eg in packages installed) then that may cause issues. (maybe). At least there is no work done (nor planed, nor will be) to make such shared usage possible.
Also no idea what happens if 2 IDE are open, and one changes the shared options. The other may not see those changes, and undo them. Or anything may happen."

Work on this has been planned, actually, in that I do have a tentative design. The usual scenario for something like this is when you do have multiple developers sharing the same box over a network using thin clients. A project manager would want them all sharing some config aspects, like packages the projects make use of as things only they can change on that central box, but leave things like editor window placement or widgetset to compile a project against as per user settings on their boxes. It is only tentative because much of the IDE would need to be restructured so there could be a thin-client version, and some features of BP7/OWL that Borland cut out of Delphi v1 that would support this I would want to see be re-implemented.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 5711
    • wiki
Re: 2ndary install (follow up to 2.0.0 release thread)
« Reply #3 on: February 08, 2019, 11:46:52 pm »
Really, press the "quote" button and use [ quote ] [ /quote ] tags....


I believe including that link, "http://wiki.lazarus.freepascal.org/Multiple_Lazarus#Using_lazarus.cfg_file", rather than saying "use --pcp", in the dialog would be more helpful.
Best to make a feature request on mantis of it. Might need a dedicated help page on the wiki, as that page can change/move (there are structured wiki pages called for pressing F1 elsewhere in the IDE)

My guess is that this is going to end as a "patches welcome" issue.


Quote
You've been one of the maintainers of tools/install for only 6+ years now,
Yes I remember, the previous win release builder was on a holiday for some weeks. I volunteered to step in during that absence. Somehow, .... ;)

My main priorities are SynEdit and the Debugger, and only if that leaves me any time, then I look after the installer. (Or if it is seriously broken)

Quote
Re: "I was unable to find that error in the Lazarus directory. When exactly did you get it. (start/end of installer? starting lazarus? ...)
How to reproduce. Which installer did you download and use to get it?"

It's the installer from release/win 32 bit/Laz 2.0; I didn't try the RCs. I forget the exact message, sorry, and why I said "some such", but the indication was it would invalidate using 1.8.4 so I cancelled out. This was before the start of unpacking new files, anyways.
It sound much like the dialog that happens when you start the new Lazarus for the first time (and did not make it a 2ndary install)

The install will give you warnings when you choose the install dir (not the config dir, only the install dir).

It knows from the registry, if this is/was the dir of the primary install (that you have or - in case you deleted it - that you had).
Depending on that, it will tell you, that it is not empty, that you should uninstall first, and that otherwise anything could happen.

But if you install into an empty dir, and make sure the config path is unique (in case of 2ndary) then that should be fine, and warnings can probably be ignored.