Archive: Modern UI, Directory page


Modern UI, Directory page
I have used NSIS for 3 years, and lately came up with a new product that needs installing, but with different options than my old one. It should, by default, install in My Documents. So, I found the proper incantation to bring that about:

Call GetMyDocs
!insertmacro MUI_INNERDIALOG_TEXT 1019 $0

in the ShowDirectory function, which converts My Documents into a path and then displays it in the edit box. My problem is that the Install button doesn't enable when I do that; in fact, it doesn't enable even if I Browse and manually select, or type in, the Path, which is, on my machine, E:\ .

I understand I'm using an old version of NSIS and an old version of Modern UI, but they've worked and I'm reluctant to go through a relearn to get back what I already have. If anyone has an easy fix, I'd be grateful.


Root directories are not supported as installation directories by default for the sake of the user. To allow root directories, use AllowRootDirInstall.

BTW, it'd be easier to just set $INSTDIR in .onInit instead of using page callbacks. This way, it'd also work in silent mode.

Function .onInit
StrCpy $INSTDIR $DOCUMENTS
FunctionEnd


BTW #2, there is nothing to relearn when upgrading. Backward compatibility is very important to me and I do my best to keep old scripts working as expected on new versions..

Thank you, Kichik, for the help; the script is now working like a champ, as I fully expected it would when I had the clue. And thanks for the compatibility; I'll look into upgrading both packages here soon.

Great support!