Archive: How to make sure that Installation folder doesn't contain spaces?


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


You can search the wiki for "spaces" and find the code.


I have updated the script to be more customisable and I've added a good example.

-Stu


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 ...


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


this is exactly because i asked you, i thought you may know as i don't :)

kichik what do you say?


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.


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


Uhm, yeh that's on there:
http://nsis.sourceforge.net/Check_fo...ory_path#Usage

-Stu :p


little late
oops! my fault. But, I'd say it is not clear, atleast to me :)


I'll add a little more information.

-Stu