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 Installer 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 Installer'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 Installer. 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 Installer'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 Installer, act as follows.
- 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.
- Select the Advanced - INI files page by clicking on its bullet
in the Navigation area.
- Right-click anywhere in the INI files list to open its context
menu.
- On the context menu that appears, choose Insert Key.
-
Tarma Installer creates a new Unnamed INI file key. In its INI
File Settings pane, set the following options:
- Key - Enter the key name. It may not contain the '=' character
and must be unique within the same section of the INI file, except
if you create duplicate key names without Platforms overlap.
- Data - Enter the text data associated with the key name.
- Section - Enter the name of the INI file section for the
key.
- INI file - Enter the name of the INI file. The default
value is the <WinIni> variable, which represents the standard
Windows Win.ini file. However, you may enter any suitable file
path here. To refer to an INI file that is installed along with
the rest of your application (see step 1), click on the button
to the right of the text field, then choose Browse for File...
from the menu that appears and select the desired installation
file.
- If exists - Choose the appropriate option. Refer to INI
File Settings in the online help for details.
- Separator - Enter the separator character to be used if
you selected Append using separator in the previous field.
If you leave this field blank, no separator is used.
- Platforms - Check the appropriate target platforms.
- Repeat steps 3-5 as required for other INI file keys.