Old 10th October 2003, 15:43   #1
0kermit0
Junior Member
 
Join Date: Oct 2003
Posts: 9
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.
0kermit0 is offline   Reply With Quote
Old 10th October 2003, 15:44   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
I'll check it out now.

-Stu
Afrow UK is offline   Reply With Quote
Old 10th October 2003, 15:47   #3
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
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
Afrow UK is offline   Reply With Quote
Old 10th October 2003, 15:52   #4
0kermit0
Junior Member
 
Join Date: Oct 2003
Posts: 9
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
0kermit0 is offline   Reply With Quote
Old 10th October 2003, 15:54   #5
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
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
Afrow UK is offline   Reply With Quote
Old 10th October 2003, 16:14   #6
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
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

Last edited by Afrow UK; 10th October 2003 at 17:40.
Afrow UK is offline   Reply With Quote
Old 10th October 2003, 16:42   #7
Joost Verburg
NSIS MUI Dev
 
Join Date: Nov 2001
Posts: 3,717
Should be MUI_PAGE_CUSTOMFUNCTION_LEAVE
Joost Verburg is offline   Reply With Quote
Old 13th October 2003, 07:31   #8
0kermit0
Junior Member
 
Join Date: Oct 2003
Posts: 9
i cant get it to work. i get the errors described above.

but i will try it with a new clean install-script.
0kermit0 is offline   Reply With Quote
Old 13th October 2003, 08:10   #9
0kermit0
Junior Member
 
Join Date: Oct 2003
Posts: 9
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.
0kermit0 is offline   Reply With Quote
Old 13th October 2003, 12:00   #10
Joost Verburg
NSIS MUI Dev
 
Join Date: Nov 2001
Posts: 3,717
Can you attach the script and post the compiler errors?
Joost Verburg is offline   Reply With Quote
Old 13th October 2003, 18:34   #11
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
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
Afrow UK is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump