[Overview][Constants][Types][Classes][Procedures and functions][Index] Reference for unit 'FileUtil' (#lazutils)

FindDefaultExecutablePath

FindDefaultExecutablePath - finds the default path to the named Executable file

Declaration

Source position: fileutil.pas line 101

function FindDefaultExecutablePath(

  const Executable: string;

  const BaseDir: string = ''

):string;

Arguments

Executable

  

The name of the Executable file

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

The latest version of this document can be found at lazarus-ccr.sourceforge.net.