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!
$INSTDIR path with no spacing
5 posts
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.
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.
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!
Anyway, does anybody or you know how to retrict and check the installation path without spacing inside? Thank you!
Check this script:
Put this in your installer at onVerifyInstDir or at a custom page and you can check the $INSTDIR after submission.
Good luck,
-Hendri.
Put this in your installer at onVerifyInstDir or at a custom page and you can check the $INSTDIR after submission.
Good luck,
-Hendri.
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.