Modifying INI Files

INI files are a hold-over from Windows 3.1 and earlier, where they were used extensively to store system and application settings. Since the introduction of Windows 95, Microsoft recommends that you use the Windows registry instead of INI files for those purposes. However, there may be situations where you still need to install or modify an INI file, either one used by your own application, or a system file.

Tarma ExpertInstall has a full complement of INI file editing functions, including the ability to selectively replace or append existing values in any INI file on the customer's computer. INI file modifications are automatically installed and removed with the rest of you application, and Tarma ExpertInstall's Setup program is smart enough to remove only the parts that you added to appended INI file values.

Note 1 - If, after uninstallation of your application and reversing any modifications that were made to INI files, one or more INI files turn out to be empty, they are automatically removed by Tarma ExpertInstall. Occasionally this fails, because on some systems Windows caches INI file contents and does not allow an INI file to be deleted immediately. In that case, a 0-sized file may remain behind.

Note 2 - Although Windows NT systems nominally have the standard Windows INI files Win.ini and System.ini, they map their contents to registry settings. This mapping occurs transparently to applications that use standard Windows functions like GetPrivateProfileString (including Tarma ExpertInstall's Setup program), but may in some situations lead to unexpected results. Therefore, be sure to test your application thoroughly if it depends on these or other potentially mapped INI files.

How to specify INI file modifications

To specify INI file modifications with Tarma ExpertInstall, act as follows.

  1. Decide upon the extent of the modifications. If you want to install a completely new INI file, it might be easiest to prepare a template file, install that file as per usual (see Installing Files for more information), then add any detailed modifications as described below. Because file installation takes place before system modifications such as INI file editing, this works as expected. Of course, if you want to edit an existing file such as Win.ini, the template file method is not applicable.
  2. Go to the INI File Values project page.
  3. Right-click anywhere in the list to open its context menu.
  4. On the context menu that appears, choose New INI Value.
  5. Tarma ExpertInstall creates a new INI file key. In its INI Value attributes pane, set the following options:

  6. Repeat steps 3-5 as required for other INI file keys.