MightyWeird,
The @...Dir macros do not have a trailing backslash so you have to add it. And you are calling the function from within itself - this is known as recursion and usually leads to tears, see the Recursion tutorial in the Wiki to understand what is going on.
This works for me:
Const $SearchFordir1 = @ProgramFilesDir & "\aaaa"
Const $SearchFordir2 = @ProgramFilesDir & "\bbbb"
_IsInstalled($SearchFordir1)
_IsInstalled($SearchFordir2)
Func _IsInstalled($DisplaydirName)
$iFileExists = FileExists($DisplaydirName)
If $iFileExists Then
MsgBox($MB_SYSTEMMODAL, "", "The file exists." & @CRLF & "FileExist returned: " & $iFileExists)
Else
MsgBox($MB_SYSTEMMODAL, "", "The file doesn't exist." & @CRLF & "FileExist returned: " & $iFileExists)
EndIf
EndFunc
M23