|
|
#1 |
|
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. |
|
|
|
|
|
#2 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,337
|
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 |
|
|
|
|
|
#3 |
|
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 |
|
|
|
|
|
#4 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,337
|
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 |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|