- NSIS Discussion
- How to make sure that Installation folder doesn't contain spaces?
Archive: How to make sure that Installation folder doesn't contain spaces?
rmsh
12th January 2006 01:36 UTC
How to make sure that Installation folder doesn't contain spaces?
Hi
I'm writing a very simple installer for a stupid product which will not work properly if the installation folder has any spaces. I'm very new to NSIS.
With a quick search I found that I'm going to use .onVerifyInstDir function. But, how do I know whether the installation folder has any spaces or not. Which string function should I use?
I'd higly appreciate if you can provide a cod snippet that I can use directly.
Thanks in advance
-Ramesh
kichik
12th January 2006 13:45 UTC
You can search the wiki for "spaces" and find the code.
Afrow UK
12th January 2006 19:01 UTC
I have updated the script to be more customisable and I've added a good example.
-Stu
Comm@nder21
13th January 2006 18:52 UTC
updated too, to increase spead a bit :)
btw: is it faster to scan the string recursively, like you do atm, or to scan it from the first to the last character ...
Afrow UK
14th January 2006 10:20 UTC
Thanks for that Comm@nder21 :)
Currently it's looping through from the last to the first (if that is what you mean). There won't be any noticeable speed difference if it goes from start to finish I would have thought.
-Stu
Comm@nder21
14th January 2006 14:31 UTC
this is exactly because i asked you, i thought you may know as i don't :)
kichik what do you say?
kichik
14th January 2006 14:43 UTC
Speed-wise, it shouldn't matter if you go forwards or backwards. Recursion however, as in a function calling itself, won't help you here and will only slow things down because of stack usage.
rmsh
15th January 2006 17:04 UTC
Thank you
Thanks for the solution. It works like a charm.
I had to do some more digging to find out how to call a function on leaving a page. It's be good if that portion is also added to the wiki.
Page directory "" "" DirectoryLeave
- Ramesh
Afrow UK
15th January 2006 17:58 UTC
Uhm, yeh that's on there:
http://nsis.sourceforge.net/Check_fo...ory_path#Usage
-Stu :p
rmsh
15th January 2006 18:04 UTC
little late
oops! my fault. But, I'd say it is not clear, atleast to me :)
Afrow UK
15th January 2006 18:05 UTC
I'll add a little more information.
-Stu