Skip to content
⌘ NSIS Forum Archive

Prescriptive Directory Selection control text

5 posts

RobGrant#

Prescriptive Directory Selection control text

Hi, I ask the user to specify a directory at a point during the install. I also approximately know the likely location of where the thing they're searching for is.

I also know that if I put some text into the Directory Selection control, when they click the "..." browse button, it will jump to the place specified by that text. So far so good.

Here's my problem. When I do this:

Push $0
ExpandEnvStrings $0 "%CATALINA_HOME%"
!insertmacro MUI_INSTALLOPTIONS_WRITE "chooseWebtop.ini" "Field 1" "State" "$0\webapps"
Pop $0
I want it so that if CATALINA_HOME is "C:\Program Files\temp", it will change to "C:\Program Files\temp\webapps".

What it does instead is change it to: "C:\Program Files\temp/webapps", which the control disagrees with.

Two other tries:
!insertmacro MUI_INSTALLOPTIONS_WRITE "chooseWebtop.ini" "Field 1" "State" "$0\\webapps"
- results in "C:\Program Files\temp\\webapps"

!insertmacro MUI_INSTALLOPTIONS_WRITE "chooseWebtop.ini" "Field 1" "State" "$0webapps"
- results in "C:\Program Files\tempwebapps"

!insertmacro MUI_INSTALLOPTIONS_WRITE "chooseWebtop.ini" "Field 1" "State" "$0webapps"
- results in a compiler warning.

Any ideas? Thanks in advance.
RobGrant#
Mate, to start with I thought you just completely misread my post, but you answered it beautifully, thanks!

One more question - is it possible to have the Directory Selection tree control expand the currently selected directory when it appears?

At the moment, if I choose to have "C:\Program Files\hello\goodbye" in the box (where goodbye is a directory, obviously), then click the browse "..." button, it expands "C:\Program Files\hello\", and selects "goodbye", but does not expand it. Is there any way to change this?

Thanks again
RobGrant#
Yeah...I tried that, but it didn't do anything different.

Thanks for the suggestion, though 🙂