Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 24th May 2005, 21:46   #1
muggz77
Junior Member
 
Join Date: May 2005
Location: Corvallis - OR, USA
Posts: 13
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!
muggz77 is offline   Reply With Quote
Old 24th May 2005, 22:08   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,202
Sounds like you've got a back-stroke on the end.
InstallDir "C:\Program Files\Example1"
not
InstallDir "C:\Program Files\Example1\"

-Stu

Need an installer? http://www.afrowsoft.co.uk
Afrow UK is offline   Reply With Quote
Old 24th May 2005, 23:32   #3
muggz77
Junior Member
 
Join Date: May 2005
Location: Corvallis - OR, USA
Posts: 13
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
muggz77 is offline   Reply With Quote
Old 25th May 2005, 09:54   #4
pengyou
Major Dude
 
Join Date: Mar 2003
Posts: 569
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
pengyou is offline   Reply With Quote
Old 25th May 2005, 16:13   #5
muggz77
Junior Member
 
Join Date: May 2005
Location: Corvallis - OR, USA
Posts: 13
Thanks for your help. I had tried the backslash, but did not enclose the string in quotes
muggz77 is offline   Reply With Quote
Reply
Go Back   Winamp 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