Recent

Author Topic: Does the windows installer provided on SF set a PATH to fpc.exe?  (Read 4046 times)

Gustavo 'Gus' Carreno

  • Hero Member
  • *****
  • Posts: 1125
  • Professional amateur ;-P
Hey Y'all,

Please allow me to ask this very dumb question. :-[

I got this rather strange request on my setup-lazarus GitHub action: Windows: add path to FPC to PAHT env variable.

I say rather strange because I was under the impression that it was already done via the installer provided on Source Forge, which my GitHub action uses.

Being a Linux only person for quite some time, and not having easy access to a Windows machine, I can't quickly test if it does or not.

Hence me being quite dumbfounded and coming here with this rather dumb question  :-[ and relying on your good will to give me a definitive answer.

Cheers,
Gus
Lazarus 3.99(main) FPC 3.3.1(main) Ubuntu 23.10 64b Dark Theme
Lazarus 3.0.0(stable) FPC 3.2.2(stable) Ubuntu 23.10 64b Dark Theme
http://github.com/gcarreno

Zvoni

  • Hero Member
  • *****
  • Posts: 2330
Re: Does the windows installer provided on SF set a PATH to fpc.exe?
« Reply #1 on: May 31, 2022, 08:38:20 am »
As far as i can see: No, it doesn't set/edit the PATH-Variable
And i installed Lazarus 2.2.2 last week on my Win10-Machine.
fpc.exe doesn't pop up anywhere in my environment variables
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

Gustavo 'Gus' Carreno

  • Hero Member
  • *****
  • Posts: 1125
  • Professional amateur ;-P
Re: Does the windows installer provided on SF set a PATH to fpc.exe?
« Reply #2 on: May 31, 2022, 08:51:41 am »
Hey Zvoni,

As far as i can see: No, it doesn't set/edit the PATH-Variable
And i installed Lazarus 2.2.2 last week on my Win10-Machine.

Well, I'm absolutely sure that it adds the path where lazbuild resides to the system PATH variable due to the fact that the way you call lazbuild on a CD script on the GitHub actions is without a fully qualified path. So in this case the system has to have knowledge of where the lazbuild.exe file is located.

fpc.exe doesn't pop up anywhere in my environment variables

Ermm, I may have muddled the issue here. There will be no mention of fpc.exe on the system PATH variable. What will appear is the path that contains such binary/executable.
I'm really sorry if anyone thought I implied that fpc.exe should show on the system PATH variable.

Cheers,
Gus
Lazarus 3.99(main) FPC 3.3.1(main) Ubuntu 23.10 64b Dark Theme
Lazarus 3.0.0(stable) FPC 3.2.2(stable) Ubuntu 23.10 64b Dark Theme
http://github.com/gcarreno

PascalDragon

  • Hero Member
  • *****
  • Posts: 5486
  • Compiler Developer
Re: Does the windows installer provided on SF set a PATH to fpc.exe?
« Reply #3 on: May 31, 2022, 08:58:44 am »
Being a Linux only person for quite some time, and not having easy access to a Windows machine, I can't quickly test if it does or not.

No savourer of some good wine then? :P

I have not checked, but all in all it would make sense that Lazarus only adds the path to lazbuild to the PATH (if at all), but not the one to its provided fpc cause the point of Lazarus is after all to build Lazarus projects for which you should use lazbuild which uses the Lazarus configuration which in turn has knowledge about the location of the compiler.

If you install FPC itself on the other hand I think (again, not tested) that it allows you to add the directory of fpc.exe to PATH cause after all you want to be able to use fpc directly in that case...

Zvoni

  • Hero Member
  • *****
  • Posts: 2330
Re: Does the windows installer provided on SF set a PATH to fpc.exe?
« Reply #4 on: May 31, 2022, 09:19:56 am »
Hey Zvoni,

As far as i can see: No, it doesn't set/edit the PATH-Variable
And i installed Lazarus 2.2.2 last week on my Win10-Machine.

Well, I'm absolutely sure that it adds the path where lazbuild resides to the system PATH variable due to the fact that the way you call lazbuild on a CD script on the GitHub actions is without a fully qualified path. So in this case the system has to have knowledge of where the lazbuild.exe file is located.

fpc.exe doesn't pop up anywhere in my environment variables

Ermm, I may have muddled the issue here. There will be no mention of fpc.exe on the system PATH variable. What will appear is the path that contains such binary/executable.
I'm really sorry if anyone thought I implied that fpc.exe should show on the system PATH variable.

Cheers,
Gus
OK, i might have phrased it wrong:
I've looked through my System-Variables, looking for "c:\Lazarus\blablablabla"
and nothing like that pops up there
One System to rule them all, One Code to find them,
One IDE to bring them all, and to the Framework bind them,
in the Land of Redmond, where the Windows lie
---------------------------------------------------------------------
Code is like a joke: If you have to explain it, it's bad

Gustavo 'Gus' Carreno

  • Hero Member
  • *****
  • Posts: 1125
  • Professional amateur ;-P
Re: Does the windows installer provided on SF set a PATH to fpc.exe?
« Reply #5 on: May 31, 2022, 09:21:28 am »
Hey PascalDragon

Being a Linux only person for quite some time, and not having easy access to a Windows machine, I can't quickly test if it does or not.

No savourer of some good wine then? :P

DAMN YOU meddling kids!!!  I hate it when someone points out that I'm asking something cuz I'm a bit lazy to do it :fist_in_the_air: :P
YES, of course I have wine, and to add more shame to it, I even have the preferred version supplied from the Wine HQ winery.

I have not checked, but all in all it would make sense that Lazarus only adds the path to lazbuild to the PATH (if at all), but not the one to its provided fpc cause the point of Lazarus is after all to build Lazarus projects for which you should use lazbuild which uses the Lazarus configuration which in turn has knowledge about the location of the compiler.

Well, I've made, somewhat, the same point on the first response I gave: If you're going through the motion of installing the full Monty(Lazarus+FPC), why would you then just use fpc.exe?
To me it makes sense that then you use lazbuild progname.lpi for all your CLI and GUI needs.

I think that if they don't present a really compelling argument, I'll have to redirect them to the setup-lazarus version from Olly which, I THINK, allows one to install only the FPC installer, if one is provided somewhere. Is there?

I know that we have 3 packages for Debian: Lazarus, FPC and FPC source. But I can only find/remember a single installer for the twins.

If you install FPC itself on the other hand I think (again, not tested) that it allows you to add the directory of fpc.exe to PATH cause after all you want to be able to use fpc directly in that case...

Yeah, I'm also unable to opine on this cuz I don't even know if there's an installer that only installs the FPC side of the twins.

Cheers,
Gus
Lazarus 3.99(main) FPC 3.3.1(main) Ubuntu 23.10 64b Dark Theme
Lazarus 3.0.0(stable) FPC 3.2.2(stable) Ubuntu 23.10 64b Dark Theme
http://github.com/gcarreno

Gustavo 'Gus' Carreno

  • Hero Member
  • *****
  • Posts: 1125
  • Professional amateur ;-P
Re: Does the windows installer provided on SF set a PATH to fpc.exe?
« Reply #6 on: May 31, 2022, 09:25:02 am »
Hey Zvoni,

OK, i might have phrased it wrong:
I've looked through my System-Variables, looking for "c:\Lazarus\blablablabla"
and nothing like that pops up there

Ok, now I'm doubting my own sanity, LOL!!!  :o

I now have to check my own code to see if I'm the one amending the system PATH variable to find lazbuild.exe.

Cheers,
Gus
Lazarus 3.99(main) FPC 3.3.1(main) Ubuntu 23.10 64b Dark Theme
Lazarus 3.0.0(stable) FPC 3.2.2(stable) Ubuntu 23.10 64b Dark Theme
http://github.com/gcarreno

Gustavo 'Gus' Carreno

  • Hero Member
  • *****
  • Posts: 1125
  • Professional amateur ;-P
Re: Does the windows installer provided on SF set a PATH to fpc.exe?
« Reply #7 on: May 31, 2022, 09:33:36 am »
Hey Y'all,

Yeap, I can now confirm that I'm borderline senile: It is my TypeScript code that actually adds the path to the GitHub runner.

ARGHHHHH, I hate getting old :P

@PascalDragon: Would it make sense to add an issue to the Lazarus source GitLab repo in order to ask if they can add, AT LEAST, the path to Lazarus from within the installer?
I ask this cuz I've had a look at the Inno Setup script and they do heavily insert new keys on the Windows registry, but no adding of the path, which is rather puzzling, no?
If so, would it then be asking too much if the path to the fpc.exe file could also be added?

Cheers,
Gus
« Last Edit: May 31, 2022, 09:49:09 am by Gustavo 'Gus' Carreno »
Lazarus 3.99(main) FPC 3.3.1(main) Ubuntu 23.10 64b Dark Theme
Lazarus 3.0.0(stable) FPC 3.2.2(stable) Ubuntu 23.10 64b Dark Theme
http://github.com/gcarreno

PascalDragon

  • Hero Member
  • *****
  • Posts: 5486
  • Compiler Developer
Re: Does the windows installer provided on SF set a PATH to fpc.exe?
« Reply #8 on: May 31, 2022, 01:27:47 pm »
If you install FPC itself on the other hand I think (again, not tested) that it allows you to add the directory of fpc.exe to PATH cause after all you want to be able to use fpc directly in that case...

Yeah, I'm also unable to opine on this cuz I don't even know if there's an installer that only installs the FPC side of the twins.

So then you've never stumbled upon FPC's Download page, which - for Windows - will lead you here? ;D

@PascalDragon: Would it make sense to add an issue to the Lazarus source GitLab repo in order to ask if they can add, AT LEAST, the path to Lazarus from within the installer?
I ask this cuz I've had a look at the Inno Setup script and they do heavily insert new keys on the Windows registry, but no adding of the path, which is rather puzzling, no?
If so, would it then be asking too much if the path to the fpc.exe file could also be added?

You'd have to ask the Lazarus devs about that or simply open an issue and see what response you'll get. Please note however that the Lazarus installer provides the option to create a secondary installation (where the primary config path is configured by parameter setup in the shortcut) to allow the usage of multiple Lazarus versions in parallel. There it might not be useful to add anything to PATH.

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 9915
  • Debugger - SynEdit - and more
    • wiki
Re: Does the windows installer provided on SF set a PATH to fpc.exe?
« Reply #9 on: May 31, 2022, 04:41:11 pm »
Currently the lazarus installer (as on sourceforge) does not add any PATH at all.

I don't see much of a reason to add any.
On the other hand,
- if one would add the PATH, it adds to the maintenance of the installer. And probably quite a bit. (and it currently already needs more maintenance than it gets, as there isn't the time needed -> so adding time....? no).
- And it will cause issues for people who want to use more than one install....



But to entertain the idea at least in theory.

- It would have to be a simple build in functionality of inno 5.6 (yes that is old)
- It would have to be optional / not enabled by default
   (looking at the most recent installer commit (which will for various reasons get reverted) "not default" is tricky)
- it will need to warn if you do a 2ndary install => but that needs scripting => and therefore adds to maintenance....


But if you want to
- provide a pull-request
- deal with any bugs resulting of it
  (if bugs result from it, and no fixing pull request is provided, the answer is to revert the addition)

Then we can talk about it
- based on the most recent commit reverted
- PATH setting off by default / not part of "full install"
  (afaik inno takes command line, so it can be enabled by whatever script you have)
- setting for current or all users
- warning when enabled for 2ndary install
- warning if detected a 2ndary install
- warning if making a 2ndary install, and path already has lazbuild / option to remove from path

The warnings depend on testing how it will affect a 2ndary install.
Including
- rebuilding ide
- rebuilding ide via makefile
- building projects
- building projects via "project groups" (one or several at once)

It might be, that if the PATH can be set from the installer, the IDE will then need to have an option to detect that.
- warn the user
- provide an option to override the PATH for any operation run from within the IDE.



Just a collection of "what could possible go wrong".
Hopefully nothing will go wrong in any case at all, and almost no warnings would be needed.




Gustavo 'Gus' Carreno

  • Hero Member
  • *****
  • Posts: 1125
  • Professional amateur ;-P
Re: Does the windows installer provided on SF set a PATH to fpc.exe?
« Reply #10 on: May 31, 2022, 06:48:31 pm »
Hey Martin,

- And it will cause issues for people who want to use more than one install....

I think I've never used the Windows installer before and due to that fact I was unaware of the 2ndary install option.
My, granted naive, perception was that the installer was like any other Windows install: I install software and this is the only version you're gonna get.

When the 2ndary install comes into context, then I have to agree that you're absolutely right, it would be a waste of time to add to an already complicated set of scripts to make all this work.
And on top of that forcing the user to have only the last install on the PATH makes no sense.

In the mean time I've added the functionality to my code to have the fpc.exe executable 's location added to the system PATH on the setup-lazarus action.
Which I have to be honest: We install Lazarus and the path is C:\lazarus, easy peasy. But the path to the compiler, MAN is it convoluted: C:\lazarus\fpc\<version>\bin\<cpu-os>.
I'm complaining because I had to do a horrible hack based on the installer's name to get this constructed, not where it is situated. I quite like that it's well labelled with version, cpu and os.

Cheers,
Gus
Lazarus 3.99(main) FPC 3.3.1(main) Ubuntu 23.10 64b Dark Theme
Lazarus 3.0.0(stable) FPC 3.2.2(stable) Ubuntu 23.10 64b Dark Theme
http://github.com/gcarreno

Gustavo 'Gus' Carreno

  • Hero Member
  • *****
  • Posts: 1125
  • Professional amateur ;-P
Re: Does the windows installer provided on SF set a PATH to fpc.exe?
« Reply #11 on: May 31, 2022, 06:59:31 pm »
Hey PascalDragon,

So then you've never stumbled upon FPC's Download page, which - for Windows - will lead you here? ;D

You're absolutely right, I've never went and look for this one since:
  • Me getting more involved into Lazarus as been under Linux only.
  • Me getting more involved into Lazarus has direct correlation with fpcupdeluxe's existence.

These two points kinda gave me some blindness towards the Windows options.

One other thing I have to admit is that, when I went to look for it yesterday, I landed on a download page that had 2014 as the last date it was updated.
I'm now rather confused since your link doesn't match with what I remember I accessed yesterday. More proof that I'm getting really loopy in my old age :-[

You'd have to ask the Lazarus devs about that or simply open an issue and see what response you'll get. Please note however that the Lazarus installer provides the option to create a secondary installation (where the primary config path is configured by parameter setup in the shortcut) to allow the usage of multiple Lazarus versions in parallel. There it might not be useful to add anything to PATH.

Yeap, quite right and I've said so in the answer I gave to Martin up there ⬆️

Cheers,
Gus
Lazarus 3.99(main) FPC 3.3.1(main) Ubuntu 23.10 64b Dark Theme
Lazarus 3.0.0(stable) FPC 3.2.2(stable) Ubuntu 23.10 64b Dark Theme
http://github.com/gcarreno

PascalDragon

  • Hero Member
  • *****
  • Posts: 5486
  • Compiler Developer
Re: Does the windows installer provided on SF set a PATH to fpc.exe?
« Reply #12 on: June 01, 2022, 11:48:21 am »
In the mean time I've added the functionality to my code to have the fpc.exe executable 's location added to the system PATH on the setup-lazarus action.
Which I have to be honest: We install Lazarus and the path is C:\lazarus, easy peasy. But the path to the compiler, MAN is it convoluted: C:\lazarus\fpc\<version>\bin\<cpu-os>.

Just in case you should need it, I've attached a project that lists all detected FPC and Lazarus installations (if they were done with the installers):

Code: [Select]
PS C:\Users\sb> D:\fpc-projs\tools\listinstall\listinstall.exe
Found Lazarus 2.0.8 in D:\lazarus\2.0.8\
Found Lazarus 2.2.0 in D:\lazarus\2.2\
Found Lazarus 2.0.10 in D:\lazarus\2.0.10\
Found Free Pascal 3.2.2 in D:\fpc\3.2.2\

Gustavo 'Gus' Carreno

  • Hero Member
  • *****
  • Posts: 1125
  • Professional amateur ;-P
Re: Does the windows installer provided on SF set a PATH to fpc.exe?
« Reply #13 on: June 02, 2022, 07:19:56 pm »
Hey PascalDragon,

Just in case you should need it, I've attached a project that lists all detected FPC and Lazarus installations (if they were done with the installers):

THIS IS FRIGGIN AWESOME !!!

Now... Would you be willing to put this in a GitHub/GitLab repo so I can bombard you with issues and suggestions on how we can have this tool available for GitHub actions and/or GitLab whatchyamacallit CD?

This would, for sure, ease my pain on the horrible, unreliable and just godawful hack I did to add the installed fpc.exe location to the system's PATH variable.

I love you PascalDragon, you're my hero!!  :-[ :D

Cheers,
Gus
Lazarus 3.99(main) FPC 3.3.1(main) Ubuntu 23.10 64b Dark Theme
Lazarus 3.0.0(stable) FPC 3.2.2(stable) Ubuntu 23.10 64b Dark Theme
http://github.com/gcarreno

J-G

  • Hero Member
  • *****
  • Posts: 953
Re: Does the windows installer provided on SF set a PATH to fpc.exe?
« Reply #14 on: June 02, 2022, 08:29:26 pm »
Since I now have Laz 1.6 with FPC 3.0.0 as well as Laz 2.2.0 with FPC 3.2.2  and had some difficulty with the secondary instalation, I downloaded this program to see whether I had anything 'extranious' lurking.

I had to add a [Read(Ch)] to see the result of course but was somewhat surprised to find that it didn't report that I had FPC 3.2.2  installed. 

ScreenGrab of the output attached in case this is of interest.
FPC 3.0.0 - Lazarus 1.6 &
FPC 3.2.2  - Lazarus 2.2.0 
Win 7 Ult 64

 

TinyPortal © 2005-2018