Recent

Author Topic: FPC path  (Read 10353 times)

typo

  • Hero Member
  • *****
  • Posts: 3051
FPC path
« on: July 21, 2010, 07:11:29 pm »
How to return the path of installed FPC? Thanks.

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: FPC path
« Reply #1 on: July 21, 2010, 09:14:42 pm »
Is there any way to get this path?

theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1927
Re: FPC path
« Reply #2 on: July 21, 2010, 09:29:55 pm »
FindDefaultExecutablePath(ProgramName);

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: FPC path
« Reply #3 on: July 21, 2010, 09:42:36 pm »
For me it returns an empty string.

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: FPC path
« Reply #4 on: July 21, 2010, 11:11:25 pm »
It works for "notepad.exe", but does not for "fpc.exe" or "lazarus.exe".

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2582
Re: FPC path
« Reply #5 on: July 21, 2010, 11:24:26 pm »
I don't know where this function gets its info from. Maybe it travels the PATH, but if it is on the PATH why do you need the full path to the exe ?
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: FPC path
« Reply #6 on: July 21, 2010, 11:33:29 pm »
I am writing a little tool to compile resources and need to get the path for GoRC.exe.

Leledumbo

  • Hero Member
  • *****
  • Posts: 8746
  • Programming + Glam Metal + Tae Kwon Do = Me
Re: FPC path
« Reply #7 on: July 22, 2010, 05:17:23 am »
Quote
I don't know where this function gets its info from
The function works as Marc say, so it won't find the path if the directory is not listed in PATH. See the doc. If FPC (both standalone or bundled with Lazarus) is installed using InnoSetup installer, it might be possible to get the installation PATH using registry functions.
Quote
I am writing a little tool to compile resources and need to get the path for GoRC.exe.
My suggestion is to have a dialog asking where to find GoRC.exe, or better put GoRC relative to the executable (it will work for Windows at least).

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2582
Re: FPC path
« Reply #8 on: July 22, 2010, 12:05:17 pm »
if it is on the path, you don't need the full path, since the exe already can be found :)

BTW, Getting the path can be done through GetEnvironmentvariable('PATH);
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: FPC path
« Reply #9 on: July 22, 2010, 04:46:32 pm »
OK. FPC and Lazarus are not on the Path.

What is the registry key for the FPC path? I searched registry and did not find FPC path.
« Last Edit: July 22, 2010, 04:56:27 pm by typo »

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: FPC path
« Reply #10 on: July 22, 2010, 09:17:25 pm »
Well, I searched in directory for gorc.exe and used TProcess to compile the resource.

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2582
Re: FPC path
« Reply #11 on: July 23, 2010, 12:56:48 am »
OK. FPC and Lazarus are not on the Path.

What is the registry key for the FPC path? I searched registry and did not find FPC path.

The PATH is an environment variable, not a registry key. To set it,
[windows key]+[pause/break] -> advanced -> environment variables
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: FPC path
« Reply #12 on: July 23, 2010, 01:54:09 am »
Anyway, the tool is already working.

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: FPC path
« Reply #13 on: July 25, 2010, 10:26:28 pm »
If anyone has interest on my tool, it is attached. It compiles resource files by simply picking a file name. Improvements are wellcome. (I improved it a bit.)

 

TinyPortal © 2005-2018