Reference/IfFileExists: Difference between revisions

From NSIS Wiki
Jump to navigationJump to search
(Created page with "=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 [[Reference/...")
 
mNo edit summary
 
(One intermediate revision by the same user not shown)
Line 3: Line 3:
  file_to_check_for jump_if_present [jump_otherwise]
  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 [[Reference/Goto|Goto]]s jump_if_present if the file exists, otherwise [[Reference/Goto|Goto]]s jump_otherwise. If you want to check to see if a file is a directory, use IfFileExists DIRECTORY\*.*
Checks for existence of file(s) file_to_check_for (which can be a wildcard, or a directory), and [[Reference/Goto|Gotos]] jump_if_present if the file exists, otherwise [[Reference/Goto|Gotos]] jump_otherwise. If you want to check to see if a file is a directory, use IfFileExists DIRECTORY\*.*


<highlight-nsis>IfFileExists $WINDIR\notepad.exe 0 +2
<highlight-nsis>IfFileExists $WINDIR\notepad.exe 0 +2
MessageBox MB_OK "notepad is installed"</highlight-nsis>
MessageBox MB_OK "notepad is installed"</highlight-nsis>
''Command introduced with NSIS v1.1n''

Latest revision as of 20:13, 4 June 2013

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