Registry vs. INI file for storing user configurable application settings

I'm a new Windows programmer and I'm not sure where I should store user configurable application settings. I understand the need to provide a user friendly means for the user to change application settings, like an Edit | Settings form or similar. But where should I store the values after the user hits the Apply button on that form?

What are the pros and cons of storing settings in the Windows registry vs. storing them in a local INI file or config file or similar?


Pros of config file:

  1. Easy to do. Don't need to know any Windows API calls. You just need to know the file I/O interface of your programming language.
  2. Portable. If you port your application to another OS, you don't need to change your settings format.
  3. User-editable. The user can edit the config file outside of the program executing.

Pros of registry:

  1. Secure. The user can't accidentally delete the config file or corrupt the data unless he/she knows about regedit. And then the user is just asking for trouble.
  2. I'm no expert Windows programmer, but I'm sure that using the registry makes it easier to do other Windows-specific things (user-specific settings, network administration stuff like group policy, or whatever else).

If you just need a simple way to store config information, I would recommend a config file, using INI or XML as the format. I suggest using the registry only if there is something specific you want to get out of using the registry.

Need Your Help

HTML 5 maze game - What to do after collision detection if the touch event continues?

javascript html5 html5-canvas

I am working on a maze game using the html5 canvas and javascript (i prefer using the jquery library for coding). - the game is for mobile devices and I am totaly new with using touch events

Read empty cell using Apache POI Event model

java apache-poi

I have a huge excel file with tons of columns which looks like this :-

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.