C# Class Nexus.Client.ModManagement.IniUpgradeInstaller

This installs Ini edits when a mod is being upgraded.
This differs from the regular IniInstaller in that installed edits are installed overtop of their current location. Edits are only made to Ini files if the mod being upgraded was the latest mod to edit the value in question. If the edit was not last made by the mod being upgraded, the edit is simply archived in the install log, to be used as required in future uninstallation. If an edit being installed has not been previously installed, it is installed as usual.
Inheritance: IniInstaller
Show file Open project: NexusMods/NexusModManager-4.5

Public Methods

Method Description
EditIni ( string p_strSettingsFileName, string p_strSection, string p_strKey, string p_strValue ) : bool

Sets the specified value in the specified Ini file to the given value.

This method writes the given value in the specified Ini value, if it is owned by the mod being upgraded. If the specified Ini edit is not owned by the mod being upgraded, the Ini edit is archived in the install log. If the Ini edit was not previously installed by the mod, then the normal install rules apply, including confirming overwrite if applicable.

FinalizeInstall ( ) : void

Finalizes the installation of the values.

This removes all of the file that weren't reinstalled during the upgrade.

IniUpgradeInstaller ( IMod p_modMod, IInstallLog p_ilgInstallLog, TxFileManager p_tfmFileManager, ConfirmItemOverwriteDelegate p_dlgOverwriteConfirmationDelegate ) : System.Collections.Generic

A simple constructor that initializes the object with its dependencies.

Method Details

EditIni() public method

Sets the specified value in the specified Ini file to the given value.
This method writes the given value in the specified Ini value, if it is owned by the mod being upgraded. If the specified Ini edit is not owned by the mod being upgraded, the Ini edit is archived in the install log. If the Ini edit was not previously installed by the mod, then the normal install rules apply, including confirming overwrite if applicable.
public EditIni ( string p_strSettingsFileName, string p_strSection, string p_strKey, string p_strValue ) : bool
p_strSettingsFileName string The name of the settings file to edit.
p_strSection string The section in the Ini file to edit.
p_strKey string The key in the Ini file to edit.
p_strValue string The value to which to set the key.
return bool

FinalizeInstall() public method

Finalizes the installation of the values.
This removes all of the file that weren't reinstalled during the upgrade.
public FinalizeInstall ( ) : void
return void

IniUpgradeInstaller() public method

A simple constructor that initializes the object with its dependencies.
public IniUpgradeInstaller ( IMod p_modMod, IInstallLog p_ilgInstallLog, TxFileManager p_tfmFileManager, ConfirmItemOverwriteDelegate p_dlgOverwriteConfirmationDelegate ) : System.Collections.Generic
p_modMod IMod The mod being installed.
p_ilgInstallLog IInstallLog The install log to use to log file installations.
p_tfmFileManager ChinhDo.Transactions.TxFileManager The transactional file manager to use to interact with the file system.
p_dlgOverwriteConfirmationDelegate ConfirmItemOverwriteDelegate The method to call in order to confirm an overwrite.
return System.Collections.Generic