Sign in Join

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

Mailing lists / fpc-pascal / 2012-09

Windows installer fails to add fpc binaries to PATH

10 messages · 5 people · –

Reply by email Subscribe to this list Your subscription

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

Andrew Pennebaker

fpc.exe and related binaries are installed in C:\FPC\2.6.0\bin\i386-win32, but the installer does not add this directory to the PATH environment variable. Thus, opening a Command Prompt and typing "fpc" fails.

For lack of a better install system, Advanced
Installer<http://www.advancedinstaller.com/>is decent at creating installers that correctly modify the PATH variable.

Cheers,

Andrew Pennebaker
www.yellosoft.us

Bart
to Andrew Pennebaker: fpc.exe and related binaries are installed in C:\FPC\2.6.0\bin\i386-win32, but the…
Andrew Pennebaker wrote
fpc.exe and related binaries are installed in C:\FPC\2.6.0\bin\i386-win32, but the installer does not add this directory to the PATH environment variable. Thus, opening a Command Prompt and typing "fpc" fails.

It did work perfectly on my Win7 laptop.
You might want to have"administrator privileges whilst installing (IIRC modifying the global PATH variable requires administrator privileges).

Bart

Andrew Pennebaker
to Bart
Show quoted text 5 lines
It did work perfectly on my Win7 laptop. You might want to have"administrator privileges whilst installing (IIRC modifying the global PATH variable requires administrator privileges).

I do have administrator privileges, and the installer could be built to modify the user's PATH variable instead of the system global PATH variable. Not sure which one the installer currently tries. If the installer does need to modify system global PATH, and it failed to do so, it should display an error message about this.

here's the possibility that with your previous experience using Free Pascal, you happened to manually modify PATH at some point, and then ran the Free Pascal installer. Can you help us rule this out by temporarily removing the Free Pascal binaries from your PATH, rerunning the installer, and verifying that the installer really does modify PATH? In particular, could you paste the results of echo %PATH% before and after you rerun the installer?

Vincent Snijders
to Andrew Pennebaker

2012/9/14 Andrew Pennebaker :

Show quoted text 12 lines
> It did work perfectly on my Win7 laptop. > You might want to have"administrator privileges whilst installing > (IIRC modifying the global PATH variable requires administrator > privileges). I do have administrator privileges, and the installer could be built to modify the user's PATH variable instead of the system global PATH variable. Not sure which one the installer currently tries. If the installer does need to modify system global PATH, and it failed to do so, it should display an error message about this.

In that case is modfies the user's path variable.

Show quoted text 6 lines
here's the possibility that with your previous experience using Free Pascal, you happened to manually modify PATH at some point, and then ran the Free Pascal installer. Can you help us rule this out by temporarily removing the Free Pascal binaries from your PATH, rerunning the installer, and verifying that the installer really does modify PATH? In particular, could you paste the results of echo %PATH% before and after you rerun the installer?

Well, I just checked:
http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/install/fpc.ist?view=annotate&root=fpcbuild around line 253 and further.

It matches my experience.

Maybe you are using Windows ME or older windows versions.

Vincent

Andrew Pennebaker
to Vincent Snijders
Show quoted text 9 lines
Well, I just checked: http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/install/fpc.ist?view=annotate&root=fpcbuild around line 253 and further. It matches my experience. Maybe you are using Windows ME or older windows versions.

I am using Windows 7 Professional x64. Which version are you using?

Hmm...

My Windows account has full Administrative privileges. I'm curious if the installer neglects to explicitly request administrative privileges. I bet if we edit the installer's security properties, forcing it to run in administrative mode, it will then modify PATH accordingly.

If this is the case, the installer should either explicitly ask the system for administrative privileges before attempting to modify the system global PATH. If the system grants administrative privileges, the installer should modify the system global PATH. If the system does not grant administrative privileges, then the installer should either modify the user's local PATH variable instead, or display a visible popup to the effect that the installer requires admin rights.

All of this is easily done with Advanced
Installer<http://www.advancedinstaller.com/>,
by the way. I'm not sure which tools you're using to construct the official Free Pascal Windows installer, but the output of that build process is not working on my system.

Reinier Olislagers
to Andrew Pennebaker
Andrew Pennebaker wrote 10 lines
Well, I just checked: http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/install/fpc.ist?view=annotate&root=fpcbuild around line 253 and further. It matches my experience. Maybe you are using Windows ME or older windows versions. I am using Windows 7 Professional x64. Which version are you using?

<snip>

My Windows account has full Administrative privileges. I'm curious if the installer neglects to explicitly request administrative privileges. I bet if we edit the installer's security properties, forcing it to run in administrative mode, it will then modify PATH accordingly.

So... have you verified this theory?
Have you tried running the installer explicitly as Admin (e.g. right click, Run as Admin)? Did it change the system path then?

All of this is easily done with Advanced Installer <http://www.advancedinstaller.com/>, by the way. I'm not sure which tools you're using to construct the official Free Pascal Windows installer, but the output of that build process is not working on my system.

Well, blame the tools by all means rather than help analyze and fix the problem.
It is an Inno Setup script. Inno Setup works very well for many programs, including Lazarus.
I've never heard of Advanced Installer.

If you want to look into patching the Inno Setup script, perhaps have a look at PrivilegesRequired in the [Setup] section: http://www.jrsoftware.org/ishelp/index.php?topic=setup_privilegesrequired

Good luck,
Reinier

Andrew Pennebaker
to Bart

Oh, I just remembered--I had a similar problem with CMake, where for everyone else the installer successfully modified PATH, but not on my machine.

I use a lot of command line programs, all installed in different directories, so my PATH was too long for the CMake installer to modify. There was a C-like assumption of the maximum number of characters that PATH could contain.

Perhaps the Inno Setup script, or Inno Setup itself makes a similar assumption.

One way to verify that this is the problem is for me to temporarily shorten PATH and then try the installer, and for others to temporarily lengthen PATH (e.g. add ;C:\bin over and over and over), until Inno Setup stops correctly modifying PATH.