Pascal Scripting: GetShellFolder

Inno Setup

Pascal Scripting: GetShellFolder

Prototype:

function GetShellFolder(Common: Boolean; const ID: TShellFolderID): String;

Description:

Gets the location of the specified shell folder. Returns the 'common' version of the shell folder location if Common is True and the user has administrative privileges. On failure (unlikely but possible), an empty string is returned.

Remarks:

There is little reason to use this function. It is recommended that you use the ExpandConstant function instead to get the paths of shell folders.

Example:
var
  Path: String;
begin
  Path := GetShellFolder(False, sfAppData);
  if Path <> '' then
  begin
    MsgBox('Application Data path = ' + Path, mbInformation, MB_OK);
  end
  else
  begin
    // handle failure
  end;
end;