I would like to install my setup content only to one specific directory, so I want to have the Next
button on directory selection page disabled, unless the user chooses the right folder to install to.
How can I disable the Next
button on directory selection page and enable it right after user chooses a specific directory ?
You could stop users from changing the install directory, by disabling the directory selection page. When disable the page will not be shown during the install.
The following sample shows how to disable the
Next
button when you reach theSelectDir
page and enable it only when you enter (or choose from the browse directory dialog) theC:\MySecretDir
folder (theMySecretDir
constant). The comparing is case insensitive since user can enter whatever he (or she) wants.Or if you want to enable the
Next
button only if there's a specific fileMyUniqueFile.exe
in the chosen directory, modify the code inOnDirEditChange
event handler this way: