Reference/IfFileExists
From NSIS Wiki
IfFileExists
file_to_check_for jump_if_present [jump_otherwise]
Checks for existence of file(s) file_to_check_for (which can be a wildcard, or a directory), and Gotos jump_if_present if the file exists, otherwise Gotos jump_otherwise. If you want to check to see if a file is a directory, use IfFileExists DIRECTORY\*.*
IfFileExists $WINDIR\notepad.exe 0 +2 MessageBox MB_OK "notepad is installed"
Command introduced with NSIS v1.1n