Mastering Configurations Using the IniFile Module for Seamless App Development

Mastering Configurations Using the IniFile Module for Seamless App Development

Stephen Lv8

Mastering Configurations Using the IniFile Module for Seamless App Development

Table of Contents

Disclaimer: This post includes affiliate links

If you click on a link and make a purchase, I may receive a commission at no extra cost to you.

IIniFilesComponent

This interface imports, creates, and gets INI files.

https://techidaily.com

Declaration

IIniFilesComponent : IDispatch

https://techidaily.com

Properties

Array 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()

Copy

https://techidaily.com

See also

IAdvinstProject

IFoldersComponent

IIniFile

IPredefinedFolders

https://techidaily.com

Topics

Did you find this page useful?

Please give it a rating:

Thanks!

Report a problem on this page

Information is incorrect or missing

Information is unclear or confusing

Something else

Can you tell us what’s wrong?

Send message

Also read:

  • Title: Mastering Configurations Using the IniFile Module for Seamless App Development
  • Author: Stephen
  • Created at : 2024-10-05 04:03:38
  • Updated at : 2024-10-11 07:10:18
  • Link: https://fox-place.techidaily.com/mastering-configurations-using-the-inifile-module-for-seamless-app-development/
  • License: This work is licensed under CC BY-NC-SA 4.0.
On this page
Mastering Configurations Using the IniFile Module for Seamless App Development