Skip to content
⌘ NSIS Forum Archive

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

11 posts

rmsh#

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
Comm@nder21#
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#
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#
this is exactly because i asked you, i thought you may know as i don't 🙂

kichik what do you say?
kichik#
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#
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#
Uhm, yeh that's on there:


-Stu 😛