INI Files

Initialization files are configuration files that contain easily modifiable settings for applications.

The INI file format is:

[section 1]

; comments on section 1

Var1 = abc

Var2 = 123

[section 2]

; comments on section 2

Var1 = 321

Var2 = xyz

Each section declaration begins with “[“ , and ends with “]”

Parameters are in the form var1 = abc, and are made up of a key (var1), the sign = and a value (abc).

All lines starting with comments are considered and ignored; Windows Installer ignores all lines starting with a semicolon (;)

Specific Tables for INI Files

IniFile

This table contains the information needed to set up an INI file.

IniFile

FileName

DirProperty

Section

Key

Value

Action

Component

IniFile Columns:

IniFile - the primary key for this table

FileName - the name of the .ini file where the information will be written

DirProperty - the directory path that contains the .ini file; this property can be the name of a directory in the Directory table, a property set by a search system, or any other property that represents a path.

If this field is left blank, the INI file is created in the directory specified by the WindowsFolder property.

Section- section of the INI file

Key - key in sections

Value - the value to be written

Action - the type of changes to be made:

  • 0 - create or update an INI file
  • 1 - creates an entry in an INI file (only if the entry does not already exist)
  • 3 - create a new entry or update an entry that already exists with a value, separating it with:

Component - foreign key in the first column of the Component table, and refers to the component that controls the installation of values from the INI file

RemoveIniFile

This table contains the information that the application needs to delete from an INI file

RemoveIniFile

FileName

DirProperty

Section

Key

Value

Action

Component

RemoveIniFile Columns:

RemoveIniFile - the primary key for this table

FileName - the name of the .ini file from which the information will be deleted

DirProperty - the directory path that contains the .ini file; this property can be the name of a directory in the Directory table, or a property set by a search system or any other property that represents a path.

Section - section of the INI file

Key - key in sections

Value - the value to be deleted (mandatory when the Action field is 4)

Action - the type of changes to be made:

2 - delete the entry from the INI file

4 - delete a value from an entry in the INI file

Component - the foreign key in the first column of the Component table, which refers to the component that controls the deletion of values from the INI file

Notes: The information in the INI file is deleted when the attached component is selected for uninstallation.

If the Directory column is empty, the location of the INI file is the one specified by the WindowsFolder property.

Deleting the last value in a section leads to deleting the respective section. There is no other solution to erase an entire section than to erase all its values.

Caution

  • The Windows operating system uses a number of INI files to set up various configurations.
  • These files are WIN.INI, SYSTEM.INI, PROTOCOL.INI, PROGMAN.INI, CONTROL.INI, WINFILE.INI, MSMAIL.INI, SHARED.INI and SCHDPLUS.INI.
  • Some applications add sections and entries to the WIN.INI file, and INI files to the Windows directory. It is important to take great care when adding/deleting values ​​from these files.

Advanced Installer makes it easy to add INI files, edit INI files, and offers an advanced solution for importing multiple INI files into the project.