Vernalex.com
 
 M  E  N  U
 - Guides
 - Links
 - Tools
 - Themes
 




 
 

Components Guide: Initialization Configuration Files (INIs)

Initialization configuration files are a very important component to the history of Windows. Before Windows 95 the Windows operating systems relied almost exclusively on DOS encoded text files for storing settings. This allowed you to edit the settings with a text editor, which was straight forward and simple. They were simply text files with an INI file extension that meant that they were used by a program to store and retrieve settings in and from. Generally INIs are read by a program (or by Windows) when the operating system starts, but you should be aware that some programs poll (meaning check) the INIs for updates and load them as needed. When they are read they are usually read-in completely and the settings are stored within active memory.

 

Syntax

The files are divided into sections, which are sometimes called topics. These are basically groups that separate the different settings. The section names are always surrounded in brackets ([ and ]). Topics are generally uniquely named, but some programs allow for duplicate topic titles. However, that depends on the particular implemention.

Each section has various items, but these could be called names, that can be associated with them. These are variable names that the program reading the INI relates to a particular setting. Every item will have an equals (=) sign after it. In the standard INI type the items must be under a topic and the items are typically uniquely named. However, like topics the items sometimes carry a duplicated name. This happens in programs that use samely named items to carry multiple values. So, instead of using a delimited single unique item they use multiple duplicated names, most likely for human readability.

For an INI to be useful they also need values, although these are sometimes called data or data values. These are the information after the equal sign for an item, so they represent the information for a particular variable. These generally come in three forms. The first is a boolean value, which can hold one value or another. These are typically denoted with 0 (meaning off or no) and 1 (meaning yes or on). However, they sometimes use Y/N or Yes/No or On/Off, etc as this is up to the particular implementation. The second type is a numeric value, which is a number. It is possible the number type could only be an integer, or it could be a float (decimal number). And it is possible the value will accept negatives, or that it won't. So, once again it is up to the implementation to set the limits on the number, and these may not be readily known. The third type is a string value, which is simply text with very few restrictions. They can contain phrases, numbers, a word, a single letter, and so on. Some INIs will restrict the symbols you're allowed to use, such as the equal (=) sign, but more robust implementations will allow most any value.

An interesting note is that items represent possible variable assignments. However, programs almost always have default values associated with a variable because INIs are normally seen by developers as a way to alter a program's behavior from a default state. This means that if you do not specify an item then the program will internally use a default setting for that item. But, some programs require settings for some or all of the values and without them they will either not work properly or not at all.

INIs also have the ability to use remarks. These are used with a semicolon (;) in front of the text you wish the interpreter to ignore. So, if you wanted to write a note in an INI file then you could put a semicolon and then some information after it, and that information will be ignored by the program processing the file. This is useful for reminding you what a particular setting does or such.

Return to top.

 

Important INIs

There are several important INI files that have been used for Windows. The two of most note are the system.ini file and the user.ini, which both can be found in your Windows folder. These are used heavily in versions of Windows previous to Windows 95. They are used to provide additional options in Windows 9x, but in Windows NT they simply provide backwards compatibility for older legacy programs.

The system.ini was originally designed to provide storage for the system settings of the operating system. This means that it stored font registrations, driver pointers and other things now handled in the Windows registry. This file was critical to the operation of Windows because without it the operating system didn't know how to access hardware or what mode to initialize Windows into.

The user.ini was designed to store shell settings for the active user. This would include such things as shell color settings or the desktop wallpaper. This file was far less important than the system.ini as it mainly contained visual tweaks or usability settings rather than alter the innerworkings of the operating system.

Return to top.

 

Drawbacks

The INI setting modification model provided a portable, simple and human readable configuration system. To transfer settings from one Windows installation to another you only had to backup the INI files and restore them in the new installation. And it was simplistic enough that anyone could edit them. Plus the ability that they could be edited with nothing more than a text editor was amazing.

However, the benefits of the INI ends there. They can't have permissions applied to individual settings or sections, which the registry does allow that provides a great environment for multiple users. It is text based so it's slow for a program to parse the file unlike a binary repository like the registry. And another drawback is that since it's just a text file that handle notification for modications are not used so they have to periodically poll for changes, which is either resource intensive or very time dependant.

Return to top.

 

"I know not with what weapons World War III will be fought, but World War IV will be fought with sticks and stones." --Albert Einstein


Valid HTML 4.01! Paypal Donation
Link Partners