-1

I want ISPP to check if a file/folder exists in {app} during InitializeUninstall. Is that possible?

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992

1 Answers1

0

That does not make sense. The preprocessor is run when you build the setup. Not when installing/uninstalling.


But of course you can use the constants in the Pascal Script, using the ExpandConstant function. To check a file existence, use the FileExists function.

function InitializeUninstall(): Boolean;
begin
  if FileExists(ExpandConstant('{app}\MyProg.ini')) then
  begin
    Log('File exists.');
  end
    else
  begin
    Log('File does not exist.');
  end;

  Result := True;
end;

For directories, use the DirExists function.

Martin Prikryl
  • 188,800
  • 56
  • 490
  • 992