PDA

View Full Version : Conditional registry set



robink
11-03-2003, 02:44 AM
I am using the SDCustomerInformation dialog to ask the user if he wants to install the app for all users or just himself.


What I would like to do is that, based on the users choice. I would like to write certain entries to the Registry...

e.g if he choice only current user that I want to write to the HKCU hive and HKLM otherwise.

How can can set this up.

I can set up two registry components. However do I associate it to the choice that the user makes?

RobertDickau
11-03-2003, 10:11 AM
You can use the HKEY_USER_SELECTABLE root key (in InstallScript or in the Registry view of the IDE) for this; for an ALLUSERS installation HKEY_USER_SELECTABLE maps to HKEY_LOCAL_MACHINE, otherwise it maps to HKEY_CURRENT_USER.

Mark at IS
11-03-2003, 10:12 AM
If the only difference in the two cases is HKCU versus HKLM, you can simply create the entries under the registry set's HKEY_USER_SELECTABLE root key; the entries will automatically be created under the correct target system root key based on the end user's selection in SdCustomerInformation.

robink
11-05-2003, 09:47 PM
Thank you both of you. That worked for me.