kook04
7th April 2008 18:53 UTC
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
Afrow UK
7th April 2008 19:02 UTC
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
kook04
7th April 2008 19:14 UTC
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?
Joost Verburg
7th April 2008 19:24 UTC
Maybe you need to put quotes around the individual filenames. Check the documentation of javaw.exe.
Afrow UK
7th April 2008 22:14 UTC
Yes you misunderstood.
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
kook04
8th April 2008 14:57 UTC
Thanks for your help Stu. I really appreciate it.
-Kennedy