Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What alternatives to the Windows registry exist to store software configuration settings [closed]

Tags:

c++

registry

mfc

I have a C++ MFC app that stores all of its system wide configuration settings to the registry. Previously, we used .INI files, and changed over to using the registry some years back using

SetRegistryKey("MyCompanyName");

We now get regular support calls from users having difficulty migrating from PC and Windows version to another, and I've come to the conclusion that using the registry causes many more problems than it solves. I don't particularly want to go back to .INI files either as I'd like to store settings per user, so the plan is to write my own versions of the GetProfile... and SetProfile... functions to work with a database. Has anybody done this already, and does anyone know of an existing drop in replacement library for registry usage that wouldn't require too much code modification? Ideally, I'd also like it to have options to read initial values from the registry to support existing users.

like image 788
SmacL Avatar asked Feb 19 '10 15:02

SmacL


People also ask

Does Linux have registry like Windows?

Linux does not have a registry. This is both a blessing and a curse. The blessing is that configuration files are most often kept as a series of text files (think of the Windows .

What is the Windows Registry used for?

The registry helps Windows manage and operate your computer, ensuring access to critical resources and helping important programs configure settings. A hierarchical database structure of keys and values makes up the registry.

Which Windows Registry file stores the user preferences on the computer?

The HKEY_LOCAL_MACHINE\Software\Classes key contains default settings that can apply to all users on the local computer.

Does Windows still use the registry?

The Windows Registry is a hierarchical database that stores low-level settings for the Microsoft Windows operating system and for applications that opt to use the registry. The kernel, device drivers, services, Security Accounts Manager, and user interfaces can all use the registry.


1 Answers

Boost has a library called Boost.PropertyTree that abstracts settings into a hierarchical structure. It can be serialized to a number of formats, such as XML, JSON, and INI.

Store these files in %APPDATA%. Storing them in the same directory as the executable is not a good idea, as %PROGRAMFILES% is not writable by regular users from XP on.

like image 195
Roel Avatar answered Oct 07 '22 03:10

Roel