Inno Setup Preprocessor: ExecAndGetFirstLine

Prototype

str ExecAndGetFirstLine(str Filename, str? Params, str? WorkingDir)

Description

Executes specified executable or batch file and reads the first non-empty line from its output.

The Filename parameter specifies the filename of the executable or batch file. If this does not includes quotes then the function will add them automatically. If you have a single string containing both a filename and parameters (e.g. a command line obtained from an UninstallString registry value), you need not separate them yourself; just pass '>' in this parameter, and the full command line in the Params parameter. (Note that when this is done, the function's special platform-independent support for .bat and .cmd files is disabled; it simply passes the specified command line to CreateProcess without any processing.)

The Params parameter may be used to specify parameters for the process.

The WorkingDir parameter may be used to specify the working directory of the process. If this is omitted or empty it will try to extract a pathname from the Filename parameter and use that as the initial current directory for the process.

See also

Exec