Merge-IniFile

This command can be used to add multiple entries or entire sections to an INI file. The value specified in Name of INI file can denote both an existing and a new INI file.

For each specified section, the system checks whether it already exists or whether it must be created. If extensions are made in existing sections, existing values are updated. The command supports all types of variables. The variables are converted to their current values when the command is executed, for example, ${env:SystemRoot} becomes the Windows directory.

Note: Starting with version 3.0 of the PPB, the Merge-IniFile command can also be generated by dragging and dropping configuration files (*.ini and *.cfg) into the script window. If the files are already in the package directory, the source path is referenced relatively with .\, if the source files are outside the package directory, the full path is taken.


Settings:

  • Name of INI file
    INI file to be changed. The use of variables is possible. Use the "..." button to select an existing file (on the packaging system) or enter the path manually.
  • Extension
    Entries of the INI file to be newly created or existing entries to be updated.
  • Confirm changes
    If selected, the user must confirm every change to an existing entry in a dialog box.
  • Use 32-Bit mode on x64 computer
    If the script is executed on a 64-bit operating system, the counterpart for 32-bit applications SysWOW64 can be used automatically when referring to the SYSTEM32 directory.


Example:

The displayed sections and entries are inserted into the WIN.INI file in the Windows directory.


Corresponds to DSM eScript command:

  • AddIni


See also: