Archive: CheckForSpaces from the Archive ?


CheckForSpaces from the Archive ?
Hello,

the CheckForSpaces from the Archive (http://nsis.sourceforge.net/archive/...php?pageid=179) doesnt work in the cvs-version.

what should i do to get it to work ?

with 2.0b3 it worked.


I'll check it out now.

-Stu


I'm not running latest CVS version, and it works fine (on both paths with and without spaces).
It must be the latest CVS version causing a problem...

[edit]What happens?[/edit]

-Stu


i get the "spaces-error" 5 times if i want to change the install-dir (but there are no spaces in there).

Here is the code:

Function .onVerifyInstDir

Call CheckForSpaces
Pop $R0

IfFileExists $INSTDIR\execute\payslip.exe PathGood

Abort ;
PathGood:

FunctionEnd


You have to

Push $INSTDIR
Call CheckForSpaces
Pop $INSTDIR

If $INSTDIR has spaces in it (Push), then it will report an error, then $INSTDIR will have all spaces removed (from Pop).

-Stu


I've just updated the script page, so now it goes back to the directory page if the user has entered a path containing spaces.

Just call the function like so:
Page Directory "" "" "CheckForSpaces"

Or MUI:
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE "CheckForSpaces"
!insertmacro MUI_PAGE_DIRECTORY

-Stu


Should be MUI_PAGE_CUSTOMFUNCTION_LEAVE


i cant get it to work. i get the errors described above.

but i will try it with a new clean install-script.


hi again,

there is a problem with the "IfFileExist" and the "Checkforspaces-Function".

i comented the checkforspaces-function-call out and it works.

Function .onVerifyInstDir

;Push $INSTDIR
;Call CheckForSpaces
;Pop $INSTDIR

;StrCpy $INSTDIR $R0

IfFileExists $INSTDIR\execute\test.exe PathGood

Abort ;
PathGood:


FunctionEnd



But i want to call the checkforspaces function before the "IfFileExist". With 2.0b3 it works.


Can you attach the script and post the compiler errors?


Well thats quite obvious; you are setting $INSTDIR to whatever $R0 is, so if $R0 = "" then IfFileExists will fail. Remove the StrCpy $INSTDIR $R0 completely.

And you should also check back at the archive page for this function (http://nsis.sourceforge.net/archive/...php?pageid=179)
I've added some important stuff to it, and it is called differently too.

-Stu