Re: Registry vs .ini Win 2000

From: Ndi (Ndi_at_Ndi.ro)
Date: 09/22/04


Date: Wed, 22 Sep 2004 19:49:38 +0300

Registry:
  * Centralised backup of all settings by the user (through backup)
  * Faster access (Registry is cached at all times)
  * Per-value, per-key security
  * More acesible patching of eventual errors (through a .reg file)
  * User-transparent. If you want a "hidden" setting, you don't use a file.
Especially .INI
  * Data format-proof. Registry can hold anything (just keep the size down
if you write in MY registry)

INI files:
  * Survives re-installation of the OS
  * Allows complete removal of settings, porting, network distribution
  * Simpler layout and debugging (anyone can edit and delete an INI with no
danger of nuking other programs)
  * Ability to uninstall ny (oh-so-frequent) deletion of the folder.
  * developed-for-ini-files software is easy to port. Linux, for example,
has no registry but it does support INI and configuration files (that are,
basically, ini files with different syntax)
  * debugging is easier, as INI files can be easyly diff 'd (FC /L)

  More should be said, but basically that's the idea. If you build for
stability, you should have an ini file. A recovery tool with registry
settings isn't the best option. If you build for speed, registry is better.

  Also, storing in a file keeps the load of the registry. As stated, it's
cached and more you store, more RAM you hog. OTOH, not everything can be
stored into an INI, like raw data and multi-line text, not to mention
formatted text (unless you convert it).

  As a developer, I go for the registry for simple settings I can nuke at
any time (window coordinates, options, etc) and keep INI files for critical
things, like addon locations and other stuff that might be needed after a
crash. A dual solution might work for the best.

  Sometimes, however, you have no choice. Like when building a web-updating
tool, it needs to read the installation path from the registry, an INI file
is useless. Or a browser object, shell location, etc which needs to access a
path from anywhere. In short, it's your call. There is no such thing as
incompatibility, an INI file will never change or outdate because you write
it and it's -as far as the system is concerned- proprietary.

--
Andrei "Ndi" Dobrin
Brainbench MVP
www.Brainbench.com


Relevant Pages

  • Re: Does Sonia Colemans MPP/Multimedia download apply to Windows XP?
    ... The first one is labeled Registry Editor, ... MCI settings are in the system Registry. ... Echo ... > Look at the screen shots for the registry settings for WinXP as opposed to> the INI files. ...
    (microsoft.public.powerpoint)
  • Re: square bullets
    ... that it makes backing up programs' settings somewhat easier, ... INI files don't allow multiple levels of hierarchy, ... drop" design, and if each control needs to store its own settings somewhere, ... registry again of course) rather than somehow having to interact with the ...
    (sci.electronics.design)
  • Re: Using INI files
    ... You can use INI files or the system registry to save settings ...
    (microsoft.public.excel.programming)
  • Re: Best Programming Practice?
    ... correctly it shouldn't matter if it's registry, ini, xml or whatever. ... Storing preferences in files does not necessarily equal ini files. ... "new and improved" version of ini files are XML files. ... Paged Pool memory use under windows 2000. ...
    (microsoft.public.windows.terminal_services)
  • Re: .ini .dat or registry question
    ... > Which is better used to store 2 or 3 simple program settings, an ini file, dat file or the registry. ... implementing this with INI files is possible but not as clean. ... you should be fairly restrained about what and how much information you do store in the registry - there ...
    (microsoft.public.vb.winapi)