Board index » cppbuilder » Re: Registry

Re: Registry


2007-12-01 03:11:02 PM
cppbuilder69
On another note Alan, I remember that what I do is not store
centralized setting in the registry, but in a common location
in the hard disk.
First I call SHGetSpecialFolderLocation with
nFolder = CSIDL_COMMON_APPDATA;
This gives the Documents and Settings folder then I go
[docs and settings]\\company\\product\\product.ini
and write to this ini file.
This is how I centralize my settings....and it works with
non-admin accounts.
Quote
>
>It will work in Win2k (all), WinXp Pro, Win2003 Server(s), Win Vista
(all).
Quote
>
Sorry about the mis-information.....
Alan Bellingham wrote:
Quote
Colin B Maharaj < XXXX@XXXXX.COM >wrote:

>For all user settings, use HKEY_USERS (your hKey)
>then.....
>".DEFAULT\\Software\\Your Company\\Your Software Title\\" (your SubKey)
>as the starting point for your settings.....
>
>It will work in Win2k (all), WinXp Pro, Win2003 Server(s), Win Vista (all).
>
>I have software that works on all these platforms without any
>tricky coding and all work perfectly - same code base same EXE.

Unfortunately, attempting to create a new key under
HKEY_USERS\.DEFAULT\Software just fails with an error for me.

(That the HKEY_USERS\.DEFAULT appears to be the place where the Local
System account stores stuff (and nothing to do with default users at
all) probably doesn't help.)

The *only* keys on this machine that I have write access to are
HKEY_USERS\S-1-5-21-796845957-117609710-839522115-1003 and
HKEY_USERS\S-1-5-21-796845957-117609710-839522115-1003_Classes, which I
am under the impression is specific to this user SID.

So I think I don't understand your solution. Remember, the objective is
to provide a place where all users can both read and write values.

My personal inclination would be to create a key during installation as
HKEY_LOCAL_MACHINE\Software\MyCompany\MySoftware\SharedSettings, and set
that key to be accessible to all. That'd require elevated permissions
during install, but I need that anyway.

Alan Bellingham
 
 

Re:Re: Registry

Colin B Maharaj < XXXX@XXXXX.COM >wrote:
Quote
Alan I am embarrassed, you are right.....(after swearing by my methods).

This means most of my customers are running as Admin accounts...
(bummer)... I will keep looking for a solution.....

:(
Damn. I was really hoping you did have a solution. (It does seem an
interesting shortcoming in the registry that there doesn't seem to be a
central place as asked for by the OP.)
Alan Bellingham
--
Team Browns
<url:www.borland.com/newsgroups/>Borland newsgroup descriptions
<url:www.borland.com/newsgroups/netiquette.html>netiquette