Best Practices For Ini Files
Best Practices For Ini Files
The inifile table contains the .ini information that the application needs to set in an .ini file.
<image1>
Refer to the relevant section below for information on how to handle these issues:
1. Ini file contains comments
<image2>
The ini file in the screenshot above contains commented sections designated by a semi-colon, ‘;’. This
is seen as incorrectly formatted by Installshield and is not brought in through the inifile table.
Best Practice:
The best practice in this case is to extract the comment sections from the ini file, and to place them in a
new text file with the same name, installed to the same location.
In the case above the sections highlighted in red are removed from bcl.ini and placed in a new file
called bcl.txt; this is then installed to the same location as bcl.ini, which can in turn then be installed
through the inifile table.
2. Ini file contains repeated values
<image3>
In the ini file above, there are repeated values under the same section headings.
This ini file is captured properly and included/represented correctly in the inifile table, but when the
application is installed only the first value appears in the ini file:
<image4>
The values highlighted in red in the first screenshot do not appear in the ini file after installation (see
above screenshot) and obviously this is incorrect behavior.
Best Practice:
This is an exception to normal ini file best practice. The ini file in question should be installed through
the file table and the customer should be notified to ensure that no previously existing settings are
overwritten during installation.
3. Ini file contains repeated sections
<image5>
This is a similar scenario to issue two above, but in this case, there are repeated sections in the ini file.
e.g. In the ini file in the screenshot above, section SameSect appears three times with three different
sets of values.
This ini file is captured properly and included/represented correctly in the inifile table, but when the
application is installed only the first section appears in the ini file:
<image6>
Only the first appearance of SameSect is installed (see above screenshot) and the sections highlighted
in red from the first screenshot do not appear. This is incorrect behavior.
Best Practice:
This is an exception to normal ini file best practice. The ini file in question should be installed through
the file table and the customer should be notified to ensure that no settings are overwritten during
installation.
4. Ini file value(s) too long for the inifile table
<image7>
In the ini file above, the value EventScript119 (highlighted section), contains too many characters to
be handled correctly by Installshield. The entry in the inifile table will be a clipped version (i.e. to as
many characters as it can handle) and this will result in information being lost. This is not desired
behavior and can even cause Installshield to crash.
Best Practice:
This is an exception to normal ini file best practice. The ini file in question should be installed through
the file table and the customer should be notified to ensure that no settings are overwritten during
installation.
5. Ini file has no section heading
<image8>
The ini file in the screenshot above has no section heading. This is formatted incorrectly and will not be
captured properly by Installshield.
Best Practice:
This will not be put into the inifile table by Installshield during capture and will instead be put into the
file table. A file in this format should be left to install through the file table. The customer should be
notified in case any entries are overwritten during install.