Registry Access

Posted: 11-24-2006, 04:04 PM
Hi,

I have a application which writes data to the HKLM key. This is system wide
app data, used by all users of the program (regardless of login name etc) in
fact some of it is shared between programs. What am I supposed to do under
Vista - where should I write this data to?, does it stay in the registry or
become a txt file? I've had a look around MSDN and can't find any guidelines
apart from "store it in %ALLUSERSPROFILE%", however this is a directory. Can
someone point me in the right direction.

Thanks

Tim


Reply With Quote

Responses to "Registry Access"

Chris
Guest
Posts: n/a
 
Re: Registry Access
Posted: 11-25-2006, 10:21 PM
Based on some research I did to try and answer this question (probably
through the same sites you have already been to) I would say the answer is
to write your settings out to a file.

Assuming that you have source access to all of the applications that share
these settings. I would be tempted to write a single assembly to provide
access to your settings that your applications would then reference - then
put the settings into IsolatedStorage. I'm not sure if that is a reasonable
solution for your situation or not.

Hope that helps.



"Tim Gee" <tg@dffdsfd.zzz> wrote in message
news:eiidIJ%23DHHA.4208@TK2MSFTNGP03.phx.gbl...
> Hi,
>
> I have a application which writes data to the HKLM key. This is system
> wide app data, used by all users of the program (regardless of login name
> etc) in fact some of it is shared between programs. What am I supposed to
> do under Vista - where should I write this data to?, does it stay in the
> registry or become a txt file? I've had a look around MSDN and can't find
> any guidelines apart from "store it in %ALLUSERSPROFILE%", however this is
> a directory. Can someone point me in the right direction.
>
> Thanks
>
> Tim
>
>
Reply With Quote
Gerry Hickman
Guest
Posts: n/a
 
Re: Registry Access
Posted: 11-26-2006, 11:23 PM
Chris wrote:
> Based on some research I did to try and answer this question (probably
> through the same sites you have already been to) I would say the answer
> is to write your settings out to a file.
Back to the Windows 3.1 era with INI files!

--
Gerry Hickman (London UK)
Reply With Quote
Jimmy Brush
Guest
Posts: n/a
 
Re: Registry Access
Posted: 11-27-2006, 11:34 AM
Hello,

System-wide configuration data is stored in HKLM. However, the user has to
be an administrator in order to save system-wide state data, because user
accounts are limited to only affecting their own user account, and not other
user accounts.

If you need access to HKLM, you should seperate out the chunks of your
program that need to modify HKLM into a secondary program or COM component,
set this program to require admin permission, and then run this secondary
program from your main program when needing to modify HKLM. This secondary
program will then prompt the user for admin permission (or allow an admin to
log in to approve the action) and then save the settings.

The best solution is to not save system-wide state.


--
- JB

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

Reply With Quote
Tim Gee
Guest
Posts: n/a
 
Re: Registry Access
Posted: 11-27-2006, 01:02 PM
Thanks Guys.

Has anyone found chapter & verse on this from Microsoft?

Tim

"Jimmy Brush" wrote:
> Hello,
>
> System-wide configuration data is stored in HKLM. However, the user has to
> be an administrator in order to save system-wide state data, because user
> accounts are limited to only affecting their own user account, and not other
> user accounts.
>
> If you need access to HKLM, you should seperate out the chunks of your
> program that need to modify HKLM into a secondary program or COM component,
> set this program to require admin permission, and then run this secondary
> program from your main program when needing to modify HKLM. This secondary
> program will then prompt the user for admin permission (or allow an admin to
> log in to approve the action) and then save the settings.
>
> The best solution is to not save system-wide state.
>
>
> --
> - JB
>
> Windows Vista Support Faq
> http://www.jimmah.com/vista/
>
Reply With Quote
Gerry Hickman
Guest
Posts: n/a
 
Re: Registry Access
Posted: 11-28-2006, 12:00 AM
Hi Jimmy,

I think that's a bit of an over complicated view of how it's supposed to
work. It's very simple; you have machine settings in HKLM and user
settings in HKCU. The machine settings are set at install time BUT the
user can read machine settings, they just can't write to them.

It has worked perfectly since Win NT 3.51

Jimmy Brush wrote:
> Hello,
>
> System-wide configuration data is stored in HKLM. However, the user has
> to be an administrator in order to save system-wide state data, because
> user accounts are limited to only affecting their own user account, and
> not other user accounts.
>
> If you need access to HKLM, you should seperate out the chunks of your
> program that need to modify HKLM into a secondary program or COM
> component, set this program to require admin permission, and then run
> this secondary program from your main program when needing to modify
> HKLM. This secondary program will then prompt the user for admin
> permission (or allow an admin to log in to approve the action) and then
> save the settings.
>
> The best solution is to not save system-wide state.
>
>

--
Gerry Hickman (London UK)
Reply With Quote
Jimmy Brush
Guest
Posts: n/a
 
Re: Registry Access
Posted: 11-28-2006, 12:10 AM
I believe we pretty much said the same thing?


--
- JB

Windows Vista Support Faq
http://www.jimmah.com/vista/
Reply With Quote
 
LinkBack Thread Tools Display Modes
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Remote Registry Access using VB.NET to enumerate Installed Software Applications Alan King Windows XP WMI 2 11-19-2004 05:14 PM
Registry error prevents access to a Network drive Jim Paget Windows XP Accessibility 0 08-20-2003 01:05 AM
Can't access registry Annette Windows XP Accessibility 1 08-13-2003 07:55 PM
Unable to access registry in XP Pro G Mulcaster Windows XP New Users 3 08-13-2003 07:24 PM
Remote registry access denied, security tab missing in properties Sean Liming \(eMVP\) Windows XP Embedded 3 07-16-2003 10:58 AM


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90