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.
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 .
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.
The HKEY_LOCAL_MACHINE\Software\Classes key contains default settings that can apply to all users on the local computer.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With