Registry - where to save keys?

P

picoware

Hi, there are many threads out there on how to read / write to the
registry, but I am looking for tips on WHERE to save keys to. I have an
app and am currently saving to the LOCAL MACHINE subkey under
\SOFTWARE\Apps\. I also want to save a key elsewhere and was wondering
if there was a reserved area or dumping ground in the registry where
developers can save keys to?

Thx.

Dave
 
P

Peter Foot [MVP]

A good practice to follow is to create a key within HKLM\Software for your
company and product e.g.

HKLM\SOFTWARE\CompanyName\ApplicationName\

There aren't any hard rules on this, you can in theory write to anywhere you
want in the registry but it's good practise to place it somewhere
identifiable with your application.

Peter
 
P

picoware

Thanks for the info. I am already saving my app info in
HKLM\SOFTWARE\CompanyName\Appl­icationName\ , but have a need to save
elsewhere (if available) as well. So, in essence, I can save whereever
I want, but it is not good practice to do so?

Thx.
 
P

Peter Foot [MVP]

You can be flexible, you just need to ensure that anywhere you write the
data to will not interfere with other software or the OS or be interpreted
as something else - there are obviously key parts (if you excuse the pun) of
the registry for functionality like COM registration, shell extensions etc,
now for example if you were trying to hide a value somewhere e.g. perhaps it
forms part of your registration mechanism, then you can use a bit of
creativity to hide it :)
If you are going to submit your application for logo testing you need to
show that the app cleans up any registry keys it creates when its
uninstalled, and it's good practise to do this anyway.

Peter

--
Peter Foot
Windows Embedded MVP
http://www.inthehand.com | http://www.peterfoot.net

Thanks for the info. I am already saving my app info in
HKLM\SOFTWARE\CompanyName\Appl­icationName\ , but have a need to save
elsewhere (if available) as well. So, in essence, I can save whereever
I want, but it is not good practice to do so?

Thx.
 

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