The syntax for IfFileExists is
IfFileExists file_to_check offset_or_label_if_exists [offset_or_label_if_not_exists]
If you plan to execute a block or another block, be sure to jump over the second block.
So a simple case:
IfFileExists "$INSTDIR\file.txt" file_found file_not_found file_found: StrCpy $0 "the file was found" goto end_of_test ;<== important for not continuing on the else branch file_not_found: StrCpy $0 "the file was NOT found" end_of_test:
If one of the blocks is right after IfFileExists , you can use an offset of 0 instead of a useless label:
IfFileExists "$INSTDIR\file.txt" 0 file_not_found StrCpy $0 "the file was found" goto end_of_test ;<== important for not continuing on the else branch file_not_found: StrCpy $0 "the file was NOT found" end_of_test:
source share