Pascal Scripting: ExecAsOriginalUser

Inno Setup

Pascal Scripting: ExecAsOriginalUser

Prototype:

function ExecAsOriginalUser(const Filename, Params, WorkingDir: String; const ShowCmd: Integer; const Wait: TExecWait; var ResultCode: Integer): Boolean;

Description:

Executes the specified executable or batch file, using the (normally non-elevated) credentials of the user that started Setup initially. See Exec and the [Run] section flag runasoriginaluser for more information.

Remarks:

This function is not supported at uninstall time.

In very unusual failure cases (e.g. if the initial Setup process died unexpectedly), it is possible for this function to raise an exception instead of just returning False.