Registry in a Least Privileged Environment

  • Thread starter Thread starter will f
  • Start date Start date
W

will f

Greetings.

I work on an application which I would like to be able to run on Vista in a
"least privileged environment," and I have a some questions regarding the
registry in Vista.

1. Am I right to understand that, in a least privileged environment, apps
should not write to HKEY_LOCAL_MACHINE\Software anymore?
2. Is it MS's recommended practice that app should write to
HKEY_CURRENT_USER\Software instead?
3. In the case where I want an app to run with the same settings under
all user accounts, is there a registry hive for "ALL Users," or would I be
better off saving global app settings in a flat file under the C:\Users\All
Users directory?

I will be grateful for any help.

will f
 
will f said:
Greetings.

I work on an application which I would like to be able to run on Vista in
a "least privileged environment," and I have a some questions regarding
the registry in Vista.

1. Am I right to understand that, in a least privileged environment,
apps should not write to HKEY_LOCAL_MACHINE\Software anymore?
2. Is it MS's recommended practice that app should write to
HKEY_CURRENT_USER\Software instead?
3. In the case where I want an app to run with the same settings under
all user accounts, is there a registry hive for "ALL Users," or would I be
better off saving global app settings in a flat file under the
C:\Users\All Users directory?

I will be grateful for any help.

will f


Be a man and write where you like. Don't get pushed around by a set of
guidelines.
 
Here's a quick attempt to answer these:

1/ Yes
2/ Yes
3/ In general changes to the system that effect all users should require
admin rights. So you could save 'all users' settings in HKEY_LOCAL_MACHINE,
and allow individual users to override the defaults in HKEY_CURRENT_USERS,
or you could save defaults in a file.
 
Mr. Wood.

Thanks. One more question that maybe you can answer - or point me to a
resource for more Vista registry info.
I need to add some file associations to the registry, so that files created
by my app can be opened by just double-clicking on them. I normally write
the following:

Key: HKEY_CLASSES_ROOT\.xyz
Value Name: <default>
Data: xyzfile

Key: HKEY_CLASSES_ROOT\xyzfile\Shell\Open\Command
Value Name: <default>
Data: C:\Program Files\Company\MyApp\MyApp.exe %%1

Will Windows Vista permit me to create and enforce these file associations
even for a standard user account?

Thank you for your help.

- will f
 
Yes, HKEY_CLASSES_ROOT is actually a 'merge' of
HKEY_LOCAL_MACHINE\Sotware\Classes and HKEY_CURRENT_USER\Software\Classes,
so if you add your keys in HKEY_CURRENT_USER\Software\Classes they will show
up in HKEY_CLASSES_ROOT for just that user.
 
Back
Top