I want ISPP to check if a file/folder exists in {app} during InitializeUninstall
. Is that possible?
Asked
Active
Viewed 622 times
-1

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

George Hovhannisian
- 677
- 7
- 28
1 Answers
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
-
Yeah, well, the thing is, I need the check to work in the `Messages` section. Updating question. – George Hovhannisian Mar 09 '16 at 07:59
-
The updated question is here: [Change Inno Setup messages from Pascal code](http://stackoverflow.com/q/35887348/850848). – Martin Prikryl Mar 09 '16 at 10:07