Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 7th April 2008, 17:53   #1
kook04
Junior Member
 
Join Date: Mar 2008
Posts: 12
Spaces in $INSTDIR path causes problems

When a user selects an install directory that has spaces in the path (i.e., C:\Documents and Settings it is causing me multiple problems.

For example, I have the following piece of code in my script to create a start menu item that kicks off a Java application. When there are no spaces in the install directories path, it works perfect. When there are spaces, it fails.

CreateShortCut "$SMPROGRAMS\KAST\MyJ******gram.lnk" \
"$INSTDIR\cots\jre\bin\javaw.exe" \
"-cp INSTDIR\config;$INSTDIR\lib\rjicons.jar;$INSTDIR\lib\kast-flashback.jar;$INSTDIR\lib\kast-core.jar kast.client.CommandLine watchdog" \
\
"$INSTDIR\installer\images\earth.ico" "0"

Hopefully the formatting will look ok on that.

Two things happen when there is a space:

1) The icon (earth.ico) does not show up on the start menu item.

2) The java application will not execute. Instead an error message is shown which says "Can't find main class".

Thanks,

Kennedy
kook04 is offline   Reply With Quote
Old 7th April 2008, 18:02   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,202
Instead of using full paths to your Java archives, just use paths relative to $INSTDIR and use SetOutPath $INSTDIR before you create your shortcut so that the working directory is set.

Edit: What happens when you try to find the icon from the shortcut properties.

Stu

Need an installer? http://www.afrowsoft.co.uk
Afrow UK is offline   Reply With Quote
Old 7th April 2008, 18:14   #3
kook04
Junior Member
 
Join Date: Mar 2008
Posts: 12
Isn't that exactly what I'm doing? I'm using the $INSTDIR variable in the line that creates the shortcut, so I assumed that everything was relative to that.

I think maybe I am misunderstanding the use of the term "relative". Is that the case?
kook04 is offline   Reply With Quote
Old 7th April 2008, 18:24   #4
Joost Verburg
NSIS MUI Dev
 
Join Date: Nov 2001
Posts: 3,717
Maybe you need to put quotes around the individual filenames. Check the documentation of javaw.exe.
Joost Verburg is offline   Reply With Quote
Old 7th April 2008, 21:14   #5
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,202
Yes you misunderstood.
code:
SetOutPath $INSTDIR
CreateShortCut "$SMPROGRAMS\KAST\MyJ******gram.lnk" \
"$INSTDIR\cots\jre\bin\javaw.exe" \
"-cp config;lib\rjicons.jar;lib\kast-flashback.jar;lib\kast-core.jar kast.client.CommandLine watchdog" \
"$INSTDIR\installer\images\earth.ico"



Stu

Need an installer? http://www.afrowsoft.co.uk
Afrow UK is offline   Reply With Quote
Old 8th April 2008, 13:57   #6
kook04
Junior Member
 
Join Date: Mar 2008
Posts: 12
Thanks for your help Stu. I really appreciate it.

-Kennedy
kook04 is offline   Reply With Quote
Reply
Go Back   Winamp 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