registry changes

V

vovan

I installed the application which uses registry and found out that all
values moved to different location.
On Windows XP Pro it was:
My Computer\HKEY_LOCAL_MACHINE\SOFTWARE\SRS Enterprises

On Windows Vista Business it is at:
Computer\HKEY_USERS\S-1-5-21-1998095171-3843480920-389078073-1000_Classes\VirtualStore\MACHINE\SOFTWARE\SRS
Enterprises

Everything works. Windows redirects somehow to the new location.
But from the developer point of view it is much harder to find the real
location, because on XP I knew that I have to look for my company name under
My Computer\HKEY_LOCAL_MACHINE\SOFTWARE. And now there is some value
(S-1-5-21-1998095171-3843480920-389078073-1000_Classes) between my company
name and the root. Actually I can use Find, but it's much slower.
Is there any way to switch (or I even do not know how to call it) to the XP
kind (style) for value locations?

Thank you
Vovan
 
J

Jimmy Brush

Hello,

Your application's registry settings are being "moved" because you are
attempting to write to a restricted area of the registry
(HKEY_LOCAL_MACHINE) and your application does not have a Vista-style
manifest.

In Windows Vista, applications that do not request admin privileges (via a
"Windows needs your permission to continue" prompt) do not receive them.

The HKLM key requires admin permission to write to it.

Windows Vista realizes your application is not vista-compatible (because it
does not contain a vista manifest), and so "fakes out" your program by
silently moving the registry writes you make to HKLM to the
HKEY_CURRENT_USERS folder.

Thus, the data that your application "thinks" is being shared by everyone on
the computer is actually NOT being shared - each user has their own copy and
CANNOT see other user's data.

It is unacceptable to publish an application that relies on this "hack" in
order to function.

The best solution here is to stop using HKLM and use HKEY_CURRENT_USER
instead. You should also embed a Vista manifest into your application so
Windows Vista will stop doing these kinds of tricks for your application.


--
- JB
Microsoft MVP - Windows Shell/User

Windows Vista Support Faq
http://www.jimmah.com/vista/
 
D

Dave R.

Jimmy Brush said:
Hello,

Your application's registry settings are being "moved" because you are
attempting to write to a restricted area of the registry
(HKEY_LOCAL_MACHINE) and your application does not have a Vista-style
manifest.

In Windows Vista, applications that do not request admin privileges
(via a "Windows needs your permission to continue" prompt) do not
receive them.

The HKLM key requires admin permission to write to it.

Windows Vista realizes your application is not vista-compatible
(because it does not contain a vista manifest), and so "fakes out"
your program by silently moving the registry writes you make to HKLM
to the HKEY_CURRENT_USERS folder.

Thus, the data that your application "thinks" is being shared by
everyone on the computer is actually NOT being shared - each user has
their own copy and CANNOT see other user's data.

It is unacceptable to publish an application that relies on this
"hack" in order to function.

The best solution here is to stop using HKLM and use HKEY_CURRENT_USER
instead. You should also embed a Vista manifest into your application
so Windows Vista will stop doing these kinds of tricks for your
application.

So, what is the correct way / place to store global program settings so
they can be accessed and changed by all users without requiring the
users to have administrator credentials? Sounds like we need to go back
to the days of .ini files...

Regards,

Dave
 
J

Jimmy Brush

From what I can tell, there is no place for global configuration that is
read/writable by all users on the system.

Files/registry settings created from one user account may be readable from
another account, but they generally aren't writable from other accounts
(only exception I know if is the Public folder, where users may put
documents/etc that they wish to be world read/writable).

In Windows Vista, one computer account is completely seperate from another,
and so one cannot modify stuff that another user account created.

I believe Microsoft recommends that you put "initial" configuration in a
system-wide storage place, and then store changes on a per-user basis.
Administrators are the only ones who can change system-wide configuration;
so if you want this to be an option, that's fine, but your program that
changes global config will have to request admin privileges from the user.


--
- JB
Microsoft MVP - Windows Shell/User

Windows Vista Support Faq
http://www.jimmah.com/vista/
 
T

Tim

From what I can tell, there is no place for global configuration that is
read/writable by all users on the system.

Files/registry settings created from one user account may be readable from
another account, but they generally aren't writable from other accounts
(only exception I know if is the Public folder, where users may put
documents/etc that they wish to be world read/writable).

In Windows Vista, one computer account is completely seperate from another,
and so one cannot modify stuff that another user account created.

I believe Microsoft recommends that you put "initial" configuration in a
system-wide storage place, and then store changes on a per-user basis.
Administrators are the only ones who can change system-wide configuration;
so if you want this to be an option, that's fine, but your program that
changes global config will have to request admin privileges from the user.

--
- JB
Microsoft MVP - Windows Shell/User

Windows Vista Support Faqhttp://www.jimmah.com/vista/

I understand what you are writing, but how are we (developers)
supposed to handle products that have a service and a Windows
application that must share certain settings?

Take a connection string to a database for example. Are you
suggesting that during installation, I create an entry in HKCU for the
service user account and an entry for the operator user account? What
happens when the connection string changes?

For instance, the database connection changes and the operator updates
HKCU for itself. Then, via TCP/IP the operator account communicates
with the service to update it's HKCU entries. This is a considerable
amount of work to accomplish the same thing with a certain margin of
error.

I'm not adverse to change, but without a good solution, I'm not sure I
even care to bother changing for Vista.
 
G

Guest

The administrator changes it. A user shouldn't. What if the user get it
wrong, get fustrated, goes home, noone can access the DB then.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top