Archive: how do I verify the install folder?


how do I verify the install folder?
I have a NSIS installer which is using Modern UI.
I am using MUI_PAGE_DIRECTORY to do an installation directory dialog.
I wish to make it so that either the "next" button is greyed out unless the install folder contains <file> or when you press the next button, the installer wont move on unless the install folder contains <file>.
How can I do that?


Just use MUI_PAGE_CUSTOMFUNCTION_LEAVE to specify a leave function. In your leave function, you can then check for the presence of your file. Something like this:


Function dirLeave
IfFileExists '$MyFile' leavedir
MessageBox MB_OK "File '$MyFile' does exist in this location."
abort
leavedir:
; OK to leave
FunctionEnd