Old 7th October 2003, 08:29   #1
0kermit0
Junior Member
 
Join Date: Oct 2003
Posts: 9
How to check if there are spaces in the Installdir

1. Problem

How can i check if there are spaces in the $Instdir ?

i.e. i only want to allow $Instdir without any spaces in it. (test is allowed, te st is not allowed)

How can i do this ?



2. Problem

I have two sections, and i want to allow only one section to be installed. And i want another $Instdir for each section.

i.e:

InstallDir "$PROGRAMFILES\${MUI_PRODUCT}"
...
Section "Update" ; should have $Instdir

...

Section "Demo-Update" ; should have $Instdir2


I know about SetOutPath. but i want the $Instdir(2) to appear in the dest.-dir dialog.
0kermit0 is offline   Reply With Quote
Old 7th October 2003, 13:07   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
1. There is a function in the Archive that does exactly this:
http://nsis.sourceforge.net/archive/...php?pageid=179

2. The best way would probably be deciding which section you wish to install in .onInit, hide the other one using SectionSetText ${secidx} "" and setting $INSTDIR accordingly.

If you want to enable the user to select either one and set $INSTDIR accordingly you should simply set $INSTDIR to the appropriate value in the leave function of the components page according to the selection of the user. To allow the user to select only one section you should use a script similar to the one in the one-section.nsi example (in your Examples directory).

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 7th October 2003, 14:35   #3
0kermit0
Junior Member
 
Join Date: Oct 2003
Posts: 9
hello again,

thanks, but ...

how can i set the $Instdir in the leave function of the components page according to the selection?

i get an error: "not valid in function"



thanks in advance
0kermit0 is offline   Reply With Quote
Old 7th October 2003, 14:37   #4
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
StrCpy $INSTDIR "C:\new\path"

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump