yokese
21st September 2007 20:57 UTC
Limit browsing with 'DirRequest'
Hi, I've created a custom page with InstallOptions and I have a DirRequest control in it.
I'd like to use this DirRequest to chose one folder inside the 'Start' windows menu, in wich I'm going to create the shortcuts of the application to be installed.
My problem is that I'd like the user ony could chose/create folders from 'C:\Documents and Settings\All Users\Start\Programs', not below. I don't know if there's a way to limit the browsing capabilities of DirRequest or if it exist another different way to give the user the option of chose/create a folder only inside Start windows menu (All Users or current user).
Please, could you help me?
kichik
21st September 2007 21:21 UTC
You can use the StartMenu plug-in which is built exactly for this purpose. If you want to use InstallOptions, you'll need the Root setting for the DirRequest field.
yokese
21st September 2007 22:49 UTC
Thanks, I'll try that.
yokese
22nd September 2007 22:46 UTC
Hi again, I've had to use the DirRequest option because I'm using a custom page with some other controls in it.
I'm going to put a checBox for 'All Users' and I'd like to change the Root property of DirRequest control in execution time, but I don't know how to do it. I only know how to set the Root property before the initDialog in this way:
StrCpy $rootMenu "$SMPROGRAMS"
WriteINIStr "${DIRECTORY_CUSTOM_INIFILETEMP}" "Field 4" "Root" $rootMenu
InstallOptions::initDialog /NOUNLOAD ${DIRECTORY_CUSTOM_INIFILETEMP}
, but not after the dialog has been initialized. I guess it should be something similar to:
ReadINIStr $3 "${DIRECTORY_CUSTOM_INIFILETEMP}" "Field 4" "HWND"
SendMessage $3 "${WM_SETTEXT}" 0 "STR:$2"
but I can't find the way.
kichik
22nd September 2007 22:53 UTC
You can't set that option after the dialog is displayed.
yokese
23rd September 2007 11:12 UTC
Ouch :eek: