PDA

View Full Version : All Users



GFaux
06-18-2001, 06:58 PM
How can I install a registry key that is avaliable to all user profiles? For example each user wants to save their profile for an application. This should be under HKEY_CURRENT_USER, however if I install it here, then when a new user logs on, or a user with an existing profile logs on, this key will not be there as the install program creates it under the profile of the logged on user. Any ideas?

Gavin Faux
Systems Developer
Komfort Office Environments plc

POBrien
06-18-2001, 07:52 PM
hkey_users\.default

all users will inherit any entries under the .default subkey.

GFaux
06-18-2001, 08:25 PM
This works if a user does not have a profile on the machine yet, but if he already has one it does not seem to work...

Gavin Faux
Systems Developer
Komfort Office Environments plc

POBrien
06-18-2001, 09:26 PM
yes. you're right. current users don't inherit... hmmm...

GFaux
06-19-2001, 11:05 AM
I think I've found the theory of what I need to do, if not the actual 'code' solution: Windows stores the list of profiles under the HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Prof ileList (or \WinNT\ProfileList for NT/2K) key, so what I would need to do is to enumarate this key, loading the USER.DAT files into the registry then add the keys I require. Sounds simple enough, but I doubt it will be in practice...

Gavin Faux
Systems Developer
Komfort Office Environments plc

bdragon
06-19-2001, 06:46 PM
Interesting problem. May I offer an idea?
Instead of trying to effect 1 global procedure, how about a proc for exsisting users, then the \.default process to pick up new people.

A little more code, but the code is simple for both parts.

POBrien
06-20-2001, 03:29 AM
add the reg entry (permanently) in everyones login script. then when a new/existing user logs in the registry key (hkey_current_user\software\......will be added through the login script. Then the user makes changes to their profile and the application will see the reg entry present and save accordingly. Then when the new/existing user logs off the existing hkey_current_user\software\.... will be saved in their user.dat file.

my only concern is that when the user logs on again will the login script overwrite the current save profile settings in hkey_current_user or will hkey_current_user complete after the login is finished.

how about placing the reg entries on the top line in the script so the script entries will load first then hkey_current user finishes (overwriting the generic entries with the user.dat entries.

GFaux
06-20-2001, 08:33 AM
This is a non solution for me as the software is going out to customers as well as being used in house. Thanks any way :-)

Gavin Faux
Systems Developer
Komfort Office Environments plc

GFaux
06-20-2001, 03:20 PM
This is pretty much my 'temporary' solution. When the program starts, if the keys aren't there it will set up defaults keys and then carry on as usual...

Thanks.

Gavin Faux
Systems Developer
Komfort Office Environments plc

nuker167
10-09-2001, 03:01 AM
umm this is a quit good solution but current user still have many personal setting , I still need to help him to move his files to new user profile ?