IIniFilesComponent

This interface imports, creates, and gets INI files.

Declaration

IIniFilesComponent : IDispatch

Properties

Array<IIniFile> Files - Gets all the INI files from the project.

Methods

ImportIniFile(IFolder target, String source) - Import an INI file from disk with the specified source path. The INI file is imported in the target folder.

ImportIniFileS(String target, String source) - Import an INI file from disk with the specified source path. The INI file is imported in the target folder specified path.

CreateIniFile(IFolder target, String name) - Creates a new INI file in the project and returns it. The INI file is added in the target folder, with the specified name.

CreateIniFileS(String target, String name) - Creates a new INI file in the project and returns it. The INI file is added in the target folder path, with the specified name.

     $advinst = new-object -com AdvancedInstaller
$prj = $advinst.LoadProject("d:\edit_ini.aip")
$settingsIni = $prj.IniFilesComponent.Files | where {$_.Name -eq "Settings.ini"}[0]
$configSection = $settingsIni.Sections | where {$_.Name -eq "Configuration"}[0]
$newEntry = $configSection.CreateIfNotExist("new_entry", "my_value")
$csvEntry = $configSection.CreateOrAppendCommaSeparated("comma_separated_value", "my_value")
$newOrUpdateEntry = $configSection.CreateOrUpdate("update_entry", "my_value")
$removeEntry = $configSection.CreateEntryRemoval("entry_to_remove")
$prj.Save()

   

See also

IAdvinstProject

IFoldersComponent

IIniFile

IPredefinedFolders

Topics