| Reference information | |
|---|---|
| Project page | INI File Values |
| Related topics | Working with attribute panes |
An INI Value object represents a value in a Windows .ini file for installation or removal. You can add or remove entire values, or you can append or prepend partial values. INI values are identified by their name, their file section, and the actual file in which they appear, for example, the file <WindowsFolder>\MySettings.ini might contain the following:
[Section name] Value name=Value
Installation or removal of an INI value is controlled by its component. If the component is installed, the INI value's Install action is executed (which may actually remove the value); if the component is removed, the Remove action is executed. If an INI value is not linked to a component, its Install action is executed during installation of your product, and its Remove action when the product is removed.
Windows Installer requires that all INI values are linked to components; Tarma
ExpertInstall will issue a BLD:E0072
diagnostic message if this is not the case.
The installer can create, modify, or remove the INI value during product installation. The effect of the actions differs somewhat between Tarma Installer and Windows Installer, because Windows Installer does not support the full complement of installation actions.
Note: As a side effect, removal of a value may lead to removal of its section and file if the section or file are empty after the value is removed.
| Install action | Tarma Installer | Windows Installer |
|---|---|---|
|
Do not install |
The INI value is not installed. If it is already present on the target system, its value is left unchanged. | Same |
| Install if not present | The INI value is only installed if it does not already exist. If it is already present on the target system, its value is left unchanged. | Same |
| Install if present | The INI value is only installed if it already exists. In that case, the existing value is replaced by the new value. | Not supported. Behaves as Overwrite existing value. |
| Prepend to existing value | The INI value is installed. If it already exists, the new value is prepended to the existing value and the optional separator is inserted between the newly added portion and the existing value. If the value did not exist, it is created and set to the new value. The separator is not used in that case. | Not supported. Behaves as Append to existing value. |
| Append to existing value | The INI value is installed. If it already exists, the new value is appended to the existing value and the optional separator is inserted between the the existing value and the newly added portion. If the value did not exist, it is created and set to the new value. The separator is not used in that case. | Same, except that the separator is always a comma. |
| Overwrite existing value | The INI value is installed and the existing value, if any, is replaced by the new value. | Same |
| Remove partial value | If the INI value exists, the portion specified by its new value is removed from the existing value along with the optional separator character. If the resulting value is empty, the INI value is removed altogether. | Same |
| Remove if matched | If the INI value exists, it is removed if, and only if, its existing value matches the specified value. | Not supported. Behaves as Remove partial value. |
| Remove completely | If the INI value exists, it is removed in its entirety. | Same |
The installer can modify, remove, or retain the INI value during product removal. The effect of the actions differs somewhat between Tarma Installer and Windows Installer, because Windows Installer does not support the full complement of removal actions.
Note: As a side effect, removal of a value may lead to removal of its section and file if the section or file are empty after the value is removed.
| Remove action | Tarma Installer | Windows Installer |
|---|---|---|
| Do not remove | The INI value is left as-is. | Not supported; all installed INI values are automatically removed. |
| Remove partial value | If the INI value exists, the portion specified by its new value is removed from the existing value along with the optional separator character. If the resulting value is empty, the INI value is removed altogether. |
All removal actions depend on the installation action. If the installation action specified Append or Prepend, the partial value is removed; else the entire value is removed. If the resulting value is empty, it is removed altogether. |
| Remove if matched | If the INI value exists it is removed if, and only if, its existing value matches the specified value. | |
| Remove completely | If the INI value exists, it is removed in its entirety. | |
| Restore original | The INI value is restored to the value it had before the first installation action. If that value was empty or did not exist at that time, the INI value is removed in its entirety. | Not supported. Behaves as the other removal actions. |
This pane contains the following attributes and options.
| Attribute | Description |
|---|---|
| Name | Enter the name of the INI value. This name may not start or end with spaces or tabs, and may not contain the '=' character. You may use symbolic references in the name; they will be resolved when the INI value is installed. |
| Alias | Enter the alias for the INI value. This alias must be unique in the project; it is used as a key in the Windows Installer database. (Tarma Installer does not currently use the alias, but this may change in future releases.) |
| Value | Enter the value for the INI value. You may use symbolic references in the value; they will be resolved when the INI value is installed. |
| Section | Enter the name of the section in the INI file. You may use symbolic references in the name; they will be resolved when the INI value is installed. |
| INI file |
Enter the path to the INI file. For compatibility with Windows Installer, this path must have the format <folder_alias>\file_name. |
| Install action | Select the desired installation action from the drop-down list. The installation action is executed when the INI value's component is installed. If the INI value is not linked to a component, the action is executed when the product as a whole is installed. See Installation actions above for the full list of actions. |
| Remove action | Select the desired removal action from the drop-down list. The removal action is executed when the INI value's component is removed. If the INI value is not linked to a component, the action is executed when the product as a whole is removed. See Removal actions above for the full list of actions. |
| Separator |
Enter the separator character that is used for Append or Prepend installation actions. The default character is a semicolon ';', which is commonly used to separate paths in a path list, but you may choose any character that your application requires. If you leave this field blank, the new value is added to the existing value without separator. |