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.
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).