Page 1 of 1

How to detect the option Anyone vs Current User

Posted: Mon Apr 06, 2009 9:55 am
by ingvarius
There is an option in the Select Program Folder dialog:
"Install this application for:"

With
1) "Anyone who uses this computer (all users)"
2) "Only for me(current user)"

Under Setup Architecture, I can add registry keys.
I want to add one kind of registry key if the user has opted for "Anyone who uses this computer (all users)", and another, alternative key, if the user has opted for "Only for me(current user)".

How do I do this?

ingvarius

Posted: Mon Apr 06, 2009 2:08 pm
by MichaelNesmith
If you want keys to auto-switch between an HKLM and HKCU context based on the state of all-user selection, Windows Installer has a built-in mechanism to address this. Just add your registry keys under the HKEY_USER_DEFAULT hive, and they will go to their proper places.

Otherwise, you can use If and test the value of the $ALLUSERS$ variable and code necessary script behavior as needed in the MSIcode view.