Archive: multiple directory selection pages


multiple directory selection pages
This is my first day working with NSIS, and I am very impressed with what I have seen so far. I am running into one problem though.

I have a script that prompts the user for the install directory as well as an additional directory. The problem arises when I prompt the user for the second directory. For some reason, it always appends the last portion of the default install directory to the selected path.

For example, if default install directory is C:\Program Files\Example1, when the user attempts to select the second directory, something such as C:\Program Files\Example2, the text box that shows what the second directory is will show C:\Program Files\Example2\Example1.

Any help would be appreciated!


Sounds like you've got a back-stroke on the end.
InstallDir "C:\Program Files\Example1"
not
InstallDir "C:\Program Files\Example1\"

-Stu


I don't see where a backslash would be causing the problem. Here is a snippet from the script:

InstallDir $PROGRAMFILES\Company\Product
Var DATA_DIR

Page license
Page directory
PageEx directory
DirText "Please select the data directory."
DirVar $DATA_DIR
PageExEnd
Page instfiles

Function .onInit
StrCpy $DATA_DIR "C:\Program Files\data"
FunctionEnd

When the second directory page is displayed, the path is correct, but if the user clicks the browse button, and selects a directory, "\Product" is always appended and returned in $DATA_DIR


The answer is in the User Manual:

http://nsis.sourceforge.net/Docs/Chapter4.html#4.8.1.21

If InstallDir ends with a \ then the installer will stop adding \Product to the selected path


Thanks for your help. I had tried the backslash, but did not enclose the string in quotes