C# Class Nexus.Client.ModManagement.ModInstaller

This installs mods.
Inheritance: ModInstallerBase
Mostra file Open project: NexusMods/NexusModManager-4.5 Class Usage Examples

Public Methods

Method Description
Install ( ) : void

Installs the mod.

ModInstaller ( IMod p_modMod, IGameMode p_gmdGameMode, IEnvironmentInfo p_eifEnvironmentInfo, FileUtil p_futFileUtility, SynchronizationContext p_scxUIContext, IInstallLog p_ilgModInstallLog, IPluginManager p_pmgPluginManager, ConfirmItemOverwriteDelegate p_dlgOverwriteConfirmationDelegate, ReadOnlyObservableList p_rolActiveMods, ModManager p_mmModManager ) : System

A simple constructor that initializes the object with the given values.

Protected Methods

Method Description
CreateFileInstaller ( TxFileManager p_tfmFileManager, ConfirmItemOverwriteDelegate p_dlgOverwriteConfirmationDelegate ) : IModFileInstaller

Creates the file installer to use to install the mod's files.

This returns the regular ModFileInstaller.

CreateGameSpecificValueInstaller ( TxFileManager p_tfmFileManager, ConfirmItemOverwriteDelegate p_dlgOverwriteConfirmationDelegate ) : IGameSpecificValueInstaller

Creates the file installer to use to install the mod's game specific value edits.

This returns a regular IGameSpecificValueInstaller.

CreateIniInstaller ( TxFileManager p_tfmFileManager, ConfirmItemOverwriteDelegate p_dlgOverwriteConfirmationDelegate ) : IIniInstaller

Creates the file installer to use to install the mod's ini edits.

This returns the regular IniInstaller.

RegisterMod ( ) : void

Registers the mod being installed with the install log.

RunBasicInstallScript ( IModFileInstaller p_mfiFileInstaller, ReadOnlyObservableList p_rolActiveMods ) : bool

Runs the basic install script.

A basic install installs all of the files in the mod to the installation directory, and activates all plugin files.

RunScript ( TxFileManager p_tfmFileManager ) : bool

This executes the install script.

RunTasks ( ) : void

Runs the install tasks.

Private Methods

Method Description
BeginModReadOnlyTransaction ( ) : bool

Puts the mod into read-only mode.

ScriptExecutor_TaskSetCompleted ( object sender, TaskSetCompletedEventArgs e ) : void

Handles the IBackgroundTaskSet.TaskSetCompleted event of script executors.

This unwires our listeners from the executor.

ScriptExecutor_TaskStarted ( object sender, EventArgs e ) : void

Handles the IBackgroundTaskSet.TaskStarted event of script executors.

This bubbles the started task to any listeners.

Method Details

CreateFileInstaller() protected method

Creates the file installer to use to install the mod's files.
This returns the regular ModFileInstaller.
protected CreateFileInstaller ( TxFileManager p_tfmFileManager, ConfirmItemOverwriteDelegate p_dlgOverwriteConfirmationDelegate ) : IModFileInstaller
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 IModFileInstaller

CreateGameSpecificValueInstaller() protected method

Creates the file installer to use to install the mod's game specific value edits.
This returns a regular IGameSpecificValueInstaller.
protected CreateGameSpecificValueInstaller ( TxFileManager p_tfmFileManager, ConfirmItemOverwriteDelegate p_dlgOverwriteConfirmationDelegate ) : IGameSpecificValueInstaller
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 IGameSpecificValueInstaller

CreateIniInstaller() protected method

Creates the file installer to use to install the mod's ini edits.
This returns the regular IniInstaller.
protected CreateIniInstaller ( TxFileManager p_tfmFileManager, ConfirmItemOverwriteDelegate p_dlgOverwriteConfirmationDelegate ) : IIniInstaller
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 IIniInstaller

Install() public method

Installs the mod.
public Install ( ) : void
return void

ModInstaller() public method

A simple constructor that initializes the object with the given values.
public ModInstaller ( IMod p_modMod, IGameMode p_gmdGameMode, IEnvironmentInfo p_eifEnvironmentInfo, FileUtil p_futFileUtility, SynchronizationContext p_scxUIContext, IInstallLog p_ilgModInstallLog, IPluginManager p_pmgPluginManager, ConfirmItemOverwriteDelegate p_dlgOverwriteConfirmationDelegate, ReadOnlyObservableList p_rolActiveMods, ModManager p_mmModManager ) : System
p_modMod IMod The mod being installed.
p_gmdGameMode IGameMode The current game mode.
p_eifEnvironmentInfo IEnvironmentInfo The application's envrionment info.
p_futFileUtility Nexus.Client.Util.FileUtil The file utility class.
p_scxUIContext System.Threading.SynchronizationContext The to use to marshall UI interactions to the UI thread.
p_ilgModInstallLog IInstallLog The install log that tracks mod install info /// for the current game mode
p_pmgPluginManager IPluginManager The plugin manager.
p_dlgOverwriteConfirmationDelegate ConfirmItemOverwriteDelegate The method to call in order to confirm an overwrite.
p_rolActiveMods ReadOnlyObservableList The list of active mods.
p_mmModManager ModManager
return System

RegisterMod() protected method

Registers the mod being installed with the install log.
protected RegisterMod ( ) : void
return void

RunBasicInstallScript() protected method

Runs the basic install script.
A basic install installs all of the files in the mod to the installation directory, and activates all plugin files.
protected RunBasicInstallScript ( IModFileInstaller p_mfiFileInstaller, ReadOnlyObservableList p_rolActiveMods ) : bool
p_mfiFileInstaller IModFileInstaller The file installer to use.
p_rolActiveMods ReadOnlyObservableList The list of active mods.
return bool

RunScript() protected method

This executes the install script.
protected RunScript ( TxFileManager p_tfmFileManager ) : bool
p_tfmFileManager ChinhDo.Transactions.TxFileManager The transactional file manager to use to interact with the file system.
return bool

RunTasks() protected method

Runs the install tasks.
protected RunTasks ( ) : void
return void