Article View: borland.public.cppbuilder.nativeapi
Article #825Re: Registry
From: Colin B Maharaj
Date: Sat, 01 Dec 2007 07:11
Date: Sat, 01 Dec 2007 07:11
56 lines
3266 bytes
3266 bytes
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. >> >> It will work in Win2k (all), WinXp Pro, Win2003 Server(s), Win Vista (all). >> Sorry about the mis-information..... Alan Bellingham wrote: > Colin B Maharaj <noreply@myhost.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
Technical Details
Message-ID:
<47510904@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mailReferences:
<474a4ca5$1@newsgroups.borland.com> <474a90b4@newsgroups.borland.com> <474f5083@newsgroups.borland.com> <juf1l3hc9jocke5s8s8bpt4g4d8kruarg7@4ax.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,fb6bafcdf64ba755 X-Google-Attributes: gid10cc67,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Date: Sat, 01 Dec 2007 03:11:02 -0400 From: Colin B Maharaj <noreply@myhost.com> User-Agent: Thunderbird 2.0.0.9 (Windows/20071031) MIME-Version: 1.0 Newsgroups: borland.public.cppbuilder.nativeapi Subject: Re: Registry References: <474a4ca5$1@newsgroups.borland.com> <474a90b4@newsgroups.borland.com> <474f5083@newsgroups.borland.com> <juf1l3hc9jocke5s8s8bpt4g4d8kruarg7@4ax.com> In-Reply-To: <juf1l3hc9jocke5s8s8bpt4g4d8kruarg7@4ax.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Antivirus: avast! (VPS 071130-0, 11/30/2007), Outbound message X-Antivirus-Status: Clean NNTP-Posting-Host: 190.58.101.127 Message-ID: <47510904@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1196493060 190.58.101.127 (30 Nov 2007 23:11:00 -0700) Lines: 56 Path: arc1-ca.pugleaf.net!g2news1.google.com!news4.google.com!proxad.net!feeder1-2.proxad.net!213.200.89.82.MISMATCH!tiscali!newsfeed1.ip.tiscali.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail