Archive: How to check if there are spaces in the Installdir


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.


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


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


StrCpy $INSTDIR "C:\new\path"