ansonding
25th February 2003 07:51 UTC
$INSTDIR path with no spacing
Greetings!
I new to NSIS. May I know how to detect the $INSTDIR or install path with no spacing between while user choose for the installation path in wizard. For example, installation path like c:\program\app is accepted but other path like c:\program files\app is not accepted as the spacing between the path. Can somebody help me by providing some guidelines and scripting. Thanks you!
deguix
25th February 2003 08:05 UTC
I will give a example:
StrCpy $INSTDIR C:\Program Files\app
This is wrong. Why?
The compiler detect:
Instruction: StrCpy
Variable: $INSTDIR
Value: C:\Program
EndOffset: Files\app
And will return as error.
If you use quotes:
StrCpy "$INSTDIR" "C:\Program Files\app"
The compiler detect:
Instruction: StrCpy
Variable: $INSTDIR
Value: C:\Program Files\app
Understand?
It's not necessary to put a variable between quotes, but if it contain a string with spaces, have to be.
ansonding
25th February 2003 09:39 UTC
Thanks deguix for your some desclaration but that is not what I needed. I would like the installation able to detect and retrict the spacing among the installation path. Because I would like to run Java Service application which not acceptable the spacing among diretory path.
Anyway, does anybody or you know how to retrict and check the installation path without spacing inside? Thank you!
Smile2Me
25th February 2003 13:29 UTC
Check this script:
http://nsis.sourceforge.net/archive/...ances=0,11,122
Put this in your installer at onVerifyInstDir or at a custom page and you can check the $INSTDIR after submission.
Good luck,
-Hendri.
kichik
26th February 2003 10:05 UTC
Have you tried giving Java the short path name? The short path name can not contain spaces because it's used by DOS. Use GetFullPathName /SHORT $INSTDIR $INSTDIR and you'll get $INSTDIR without spaces.