Archive: onVerifyInstDir problem with XP


onVerifyInstDir problem with XP
I got a problem with the callback function 'onVerifyInstDir'.

The following code


Fucntion .onVerifyInstDir
Push $INSTDIR
Push " "
Call StrStr
Pop $R0
StrComp $R0,"" +3 0
MessageBox MB_OK|MB_ICONINFORMATION $(MSG0003)
Abort
FunctionEnd

Works fine on Windows98. This checks for the space in installed directory and gives the error message propertly. But on Windows XP, When the browse button is clicked, the directory variable value automatically updates to the Windows XP profile directory(with spaces) and the call back fucntion is executed several times and shows message box multiple times. I use NSIS Version 2.0. Any help to resolve this issue would be appreciated. thanks.

Use the leave function of the directory page. In .onVerifyInstDir you should only call Abort to disable the next button.


thanks
But i want to show a dialogbox to alert the user that he selected a directory with spaces, this works perfectly on windows 98, If I remove the MessageBox it also work on XP(no dialog box) but ok


That can done from the leave function. You shouldn't use MessageBox in .onVerifyInstDir. From the documentation:

This code will be called every time the user changes the install directory, so it shouldn't do anything crazy with MessageBox or the likes.