Search code examples
c++mfcregistry

What alternatives to the Windows registry exist to store software configuration settings


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.


Solution

  • I suggest moving over to an XML file in the same location as the executable. One benefit is that XML is portable across non-Windows machines (and even between Windows versions).

    Edit: The idea behind an XML configuration file in the same location as the executable is that the configuration file is for program configurations (not user) and for encapsulation / data hiding (not to pollute global file system directories). User configuration data should be in another file in a directory of the user or user's choice.