Problem : How to check if file exists in Inno Setup

Problem : How to check if file exists in Inno Setup

I need help using the FileExists function in Inno Setup.  Here’s my code.  Please help me replace the lines that start with an asterisk (*) :

sFileName := ExpandConstant(‘{tmp}\myprogram.exe’);
isxdl_AddFile(url1,sFileName);

* If c:\windows\system32\msvcr80.dll exists, then
sFileName2 := ExpandConstant(‘{tmp}\msvcr80.dll’);
isxdl_AddFile(url3,sFileName2);
* endif


Solution : How to check if file exists in Inno Setup

Something like:
sFileName := ExpandConstant(‘{tmp}\myprogram.exe’);
isxdl_AddFile(url1,sFileName);
if FileExists(ExpandConstant(‘{sys}\msvcr80.dll ‘)) then
begin
sFileName2 := ExpandConstant(‘{tmp}\msvcr80.dll’);
isxdl_AddFile(url3,sFileName2);
end;