I want ISPP to check if a file/folder exists in {app} during InitializeUninstall. Is that possible?
Asked
Active
Viewed 579 times
-1
Martin Prikryl
- 167,268
- 50
- 405
- 846
George Hovhannisian
- 627
- 5
- 24
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
- 167,268
- 50
- 405
- 846
-
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