Sign in Join
FPDoc Onlineexperiment

FindDefaultExecutablePath function

In unit FileUtil

Finds the default path to the named Executable file.

Declaration

pascal
function FindDefaultExecutablePath(const Executable: string; 
                                  const BaseDir: string='') : string

Arguments

Executable

The name of the Executable file.

BaseDir

Function result

Returns the filename of the Executable file with path information attached.

Description

FindDefaultExecutablePath finds the default path to the named Executable file. On Windows systems, it looks for files both with and without the '.EXE' extension.

If Executable is not an absolute filename the executable is searched using the environment variable PATH. Relative directories in PATH are expanded using BaseDir.

On non-Unix systems (e.g. Windows), it searches in BaseDir as well. While on Unix systems (e.g. Linux, OS X) it only searches in BaseDir, if PATH contains the '.' directory.

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.