Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   How to make sure that Installation folder doesn't contain spaces? (http://forums.winamp.com/showthread.php?t=235283)

rmsh 12th January 2006 00:36

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 12:45

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

Afrow UK 12th January 2006 18:01

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

-Stu

Comm@nder21 13th January 2006 17:52

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 09:20

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 13:31

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 13:43

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 16:04

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 16:58

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

-Stu :p

rmsh 15th January 2006 17:04

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

Afrow UK 15th January 2006 17:05

I'll add a little more information.

-Stu


All times are GMT. The time now is 05:41.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.