I'm writing a NSIS installer which elevates only after user chooses a path installing to which requires admin privileges. Obviously, I included MUI_DIRECTORYPAGE_VERIFYONLEAVE define, to allow the "Next" button to stay active even when the user chooses such a path. After user changes installation directory, .onVerifyInstDir is called where I am supposed to check for path validity and call Abort for graying out "Next" button. The problem is, .onVerifyInstDir is called only for valid paths, so if user enters something like "sdfasdfas" the function won't be called, and the "Next" button will stay active. Of course, I can verify path on leaving the directory page, but what I want is an inactive "Next" button for such cases. Any ideas?
Just remove MUI_DIRECTORYPAGE_VERIFYONLEAVE, the directory page does not check if you need to elevate or not.
The other option is to subclass the edit box, but then you would have to verify the path on your own.