C# Class Nexus.Client.ModManagement.InstallationLog.InstallLog

The log that tracks items that are installed by mods.
The install log can only be accessed by one install task at a time, so this object is a singleton to help enforce that policy. Note, however, that the singleton nature of the log is not meant to provide global access to the object. As such, there is no static accessor to retrieve the singleton instance. Instead, the Initialize(ModRegistry, string, string) method returns the only instance that should be used.
Inheritance: IInstallLog
Afficher le fichier Open project: NexusMods/NexusModManager-4.5 Class Usage Examples

Méthodes publiques

Méthode Description
AddActiveMod ( IMod p_modMod ) : void

Adds a mod to the install log.

Adding a mod to the install log assigns it a key. Keys are used to track file and edit versions. If there is no current transaction, the mod is added directly to the install log. Otherwise, the mod is added to a buffer than can later be committed or rolled back.

AddDataFile ( IMod p_modInstallingMod, string p_strDataFilePath ) : void

Logs the specified data file as having been installed by the given mod.

AddGameSpecificValueEdit ( IMod p_modInstallingMod, string p_strKey, byte p_bteValue ) : void

Logs the specified Game Specific Value edit as having been installed by the given mod.

AddIniEdit ( IMod p_modInstallingMod, string p_strSettingsFileName, string p_strSection, string p_strKey, string p_strValue ) : void

Logs the specified INI edit as having been installed by the given mod.

Backup ( ) : void

This backs up the install log.

GetCurrentFileOwner ( string p_strPath ) : IMod

Gets the mod that owns the specified file.

GetCurrentFileOwnerKey ( string p_strPath ) : string

Gets the key of the mod that owns the specified file.

GetCurrentGameSpecificValueEditOwner ( string p_strKey ) : IMod

Gets the mod that owns the specified Game Specific Value edit.

GetCurrentGameSpecificValueEditOwnerKey ( string p_strKey ) : string

Gets the key of the mod that owns the specified Game Specific Value edit.

GetCurrentIniEditOwner ( string p_strSettingsFileName, string p_strSection, string p_strKey ) : IMod

Gets the mod that owns the specified INI edit.

GetCurrentIniEditOwnerKey ( string p_strSettingsFileName, string p_strSection, string p_strKey ) : string

Gets the key of the mod that owns the specified INI edit.

GetFileInstallers ( string p_strPath ) : IList

Gets all of the mods that have installed the specified file.

GetGameSpecificValueEditInstallers ( string p_strKey ) : IList

Gets all of the mods that have installed the specified game specific value edit.

GetIniEditInstallers ( string p_strSettingsFileName, string p_strSection, string p_strKey ) : IList

Gets all of the mods that have installed the specified Ini edit.

GetInstalledGameSpecificValueEdits ( IMod p_modInstaller ) : IList

Gets the list of Game Specific Value edited keys that were installed by the given mod.

GetInstalledIniEdits ( IMod p_modInstaller ) : IList

Gets the list of INI edits that were installed by the given mod.

GetInstalledModFiles ( IMod p_modInstaller ) : IList

Gets the list of files that were installed by the given mod.

GetMismatchedVersionMods ( ) : IMod>>.IEnumerable

Gets the list of mods whose versions don't match the version in the install log.

GetModKey ( IMod p_modMod ) : string

Gets the key that was assigned to the specified mod.

GetPreviousFileOwner ( string p_strPath ) : IMod

Gets the mod that owned the specified file prior to the current owner.

GetPreviousFileOwnerKey ( string p_strPath ) : string

Gets the key of the mod that owned the specified file prior to the current owner.

GetPreviousGameSpecificValue ( string p_strKey ) : byte[]

Gets the value of the specified key before it was most recently overwritten.

GetPreviousIniValue ( string p_strSettingsFileName, string p_strSection, string p_strKey ) : string

Gets the value of the specified key before it was most recently overwritten.

Initialize ( ModRegistry p_mdrManagedModRegistry, string p_strModInstallDirectory, string p_strLogPath ) : IInstallLog

Initializes the install log.

IsLogValid ( string p_strLogPath ) : bool

Determines if the log at the given path is valid.

LogOriginalDataFile ( string p_strDataFilePath ) : void

Logs that the specified data file is an original value.

Logging an original data file prepares it to be overwritten by a mod's file.

LogOriginalGameSpecificValue ( string p_strKey, byte p_bteValue ) : void

Logs that the specified Game Specific Value is an original value.

Logging an original Game Specific Value prepares it to be overwritten by a mod's value.

LogOriginalIniValue ( string p_strSettingsFileName, string p_strSection, string p_strKey, string p_strValue ) : void

Logs that the specified INI value is an original value.

Logging an original INI value prepares it to be overwritten by a mod's value.

ReadVersion ( string p_strLogPath ) : System.Version

Reads the install log verion from the given install log.

Release ( ) : void

This disposes of the install log, allowing it to be re-initialized.

RemoveDataFile ( IMod p_modInstallingMod, string p_strDataFilePath ) : void

Removes the specified data file as having been installed by the given mod.

RemoveGameSpecificValueEdit ( IMod p_modInstallingMod, string p_strKey ) : void

Removes the specified Game Specific Value edit as having been installed by the given mod.

RemoveIniEdit ( IMod p_modInstallingMod, string p_strSettingsFileName, string p_strSection, string p_strKey ) : void

Removes the specified ini edit as having been installed by the given mod.

RemoveMod ( IMod p_modUninstaller ) : void

Removes the mod, as well as entries for items installed by the given mod, from the install log.

ReplaceActiveMod ( IMod p_modOldMod, IMod p_modNewMod ) : void

Replaces a mod in the install log, in a transaction.

This replaces a mod in the install log without changing its key.

ReplaceGameSpecificValueEdit ( IMod p_modInstallingMod, string p_strKey, byte p_bteValue ) : void

Replaces the edited value of the specified game specific value edit installed by the given mod.

ReplaceIniEdit ( IMod p_modInstallingMod, string p_strSettingsFileName, string p_strSection, string p_strKey, string p_strValue ) : void

Replaces the edited value of the specified INI edit installed by the given mod.

Restore ( string p_strLogPath ) : bool

This restores the first valid backup of the install log.

Méthodes protégées

Méthode Description
AddActiveMod ( IMod p_modMod, bool p_booIsSpecial ) : void

Adds a mod to the install log.

Adding a mod to the install log assigns it a key. Keys are used to track file and edit versions. If there is no current transaction, the mod is added directly to the install log. Otherwise, the mod is added to a buffer than can later be committed or rolled back.

GetMod ( string p_strKey ) : IMod

Gets the mod identified by the given key.

SaveInstallLog ( ) : void

Save the data to the Install Log file.

Private Methods

Méthode Description
GetEnlistment ( ) : TransactionEnlistment

Gets an enlistment into the ambient transaction, if one exists.

GetInstallLogModInfo ( ) : IMod>.IDictionary

Gets the mod info that is currently in the install log, indexed by mod key.

InstallLog ( ModRegistry p_mdrManagedModRegistry, string p_strModInstallDirectory, string p_strLogPath ) : System

A simple constructor that initializes the object with its dependencies.

LoadInstallLog ( ) : void

Loads the data from the Install Log file.

Method Details

AddActiveMod() public méthode

Adds a mod to the install log.
Adding a mod to the install log assigns it a key. Keys are used to track file and edit versions. If there is no current transaction, the mod is added directly to the install log. Otherwise, the mod is added to a buffer than can later be committed or rolled back.
public AddActiveMod ( IMod p_modMod ) : void
p_modMod IMod The being added.
Résultat void

AddActiveMod() protected méthode

Adds a mod to the install log.
Adding a mod to the install log assigns it a key. Keys are used to track file and edit versions. If there is no current transaction, the mod is added directly to the install log. Otherwise, the mod is added to a buffer than can later be committed or rolled back.
protected AddActiveMod ( IMod p_modMod, bool p_booIsSpecial ) : void
p_modMod IMod The being added.
p_booIsSpecial bool Indicates that the mod is a special mod, internal to the /// install log, and show not be included in the list of active mods.
Résultat void

AddDataFile() public méthode

Logs the specified data file as having been installed by the given mod.
public AddDataFile ( IMod p_modInstallingMod, string p_strDataFilePath ) : void
p_modInstallingMod IMod The mod installing the specified data file.
p_strDataFilePath string The file bieng installed.
Résultat void

AddGameSpecificValueEdit() public méthode

Logs the specified Game Specific Value edit as having been installed by the given mod.
public AddGameSpecificValueEdit ( IMod p_modInstallingMod, string p_strKey, byte p_bteValue ) : void
p_modInstallingMod IMod The mod installing the specified INI edit.
p_strKey string The key of the edited Game Specific Value.
p_bteValue byte The value installed by the mod.
Résultat void

AddIniEdit() public méthode

Logs the specified INI edit as having been installed by the given mod.
public AddIniEdit ( IMod p_modInstallingMod, string p_strSettingsFileName, string p_strSection, string p_strKey, string p_strValue ) : void
p_modInstallingMod IMod The mod installing the specified INI edit.
p_strSettingsFileName string The name of the edited INI file.
p_strSection string The section containting the INI edit.
p_strKey string The key of the edited INI value.
p_strValue string The value installed by the mod.
Résultat void

Backup() public méthode

This backs up the install log.
public Backup ( ) : void
Résultat void

GetCurrentFileOwner() public méthode

Gets the mod that owns the specified file.
public GetCurrentFileOwner ( string p_strPath ) : IMod
p_strPath string The path of the file whose owner is to be retrieved.
Résultat IMod

GetCurrentFileOwnerKey() public méthode

Gets the key of the mod that owns the specified file.
public GetCurrentFileOwnerKey ( string p_strPath ) : string
p_strPath string The path of the file whose owner is to be retrieved.
Résultat string

GetCurrentGameSpecificValueEditOwner() public méthode

Gets the mod that owns the specified Game Specific Value edit.
public GetCurrentGameSpecificValueEditOwner ( string p_strKey ) : IMod
p_strKey string The key of the edited Game Specific Value.
Résultat IMod

GetCurrentGameSpecificValueEditOwnerKey() public méthode

Gets the key of the mod that owns the specified Game Specific Value edit.
public GetCurrentGameSpecificValueEditOwnerKey ( string p_strKey ) : string
p_strKey string The key of the edited Game Specific Value.
Résultat string

GetCurrentIniEditOwner() public méthode

Gets the mod that owns the specified INI edit.
public GetCurrentIniEditOwner ( string p_strSettingsFileName, string p_strSection, string p_strKey ) : IMod
p_strSettingsFileName string The name of the edited INI file.
p_strSection string The section containting the INI edit.
p_strKey string The key of the edited INI value.
Résultat IMod

GetCurrentIniEditOwnerKey() public méthode

Gets the key of the mod that owns the specified INI edit.
public GetCurrentIniEditOwnerKey ( string p_strSettingsFileName, string p_strSection, string p_strKey ) : string
p_strSettingsFileName string The name of the edited INI file.
p_strSection string The section containting the INI edit.
p_strKey string The key of the edited INI value.
Résultat string

GetFileInstallers() public méthode

Gets all of the mods that have installed the specified file.
public GetFileInstallers ( string p_strPath ) : IList
p_strPath string The path of the file whose installers are to be retrieved.
Résultat IList

GetGameSpecificValueEditInstallers() public méthode

Gets all of the mods that have installed the specified game specific value edit.
public GetGameSpecificValueEditInstallers ( string p_strKey ) : IList
p_strKey string The key whose installers are to be retrieved.
Résultat IList

GetIniEditInstallers() public méthode

Gets all of the mods that have installed the specified Ini edit.
public GetIniEditInstallers ( string p_strSettingsFileName, string p_strSection, string p_strKey ) : IList
p_strSettingsFileName string The Ini file containing the key whose installers are to be retrieved.
p_strSection string The section containing the key whose installers are to be retrieved.
p_strKey string The key whose installers are to be retrieved.
Résultat IList

GetInstalledGameSpecificValueEdits() public méthode

Gets the list of Game Specific Value edited keys that were installed by the given mod.
public GetInstalledGameSpecificValueEdits ( IMod p_modInstaller ) : IList
p_modInstaller IMod The mod whose isntalled edits are to be returned.
Résultat IList

GetInstalledIniEdits() public méthode

Gets the list of INI edits that were installed by the given mod.
public GetInstalledIniEdits ( IMod p_modInstaller ) : IList
p_modInstaller IMod The mod whose isntalled edits are to be returned.
Résultat IList

GetInstalledModFiles() public méthode

Gets the list of files that were installed by the given mod.
public GetInstalledModFiles ( IMod p_modInstaller ) : IList
p_modInstaller IMod The mod whose isntalled files are to be returned.
Résultat IList

GetMismatchedVersionMods() public méthode

Gets the list of mods whose versions don't match the version in the install log.
public GetMismatchedVersionMods ( ) : IMod>>.IEnumerable
Résultat IMod>>.IEnumerable

GetMod() protected méthode

Gets the mod identified by the given key.
protected GetMod ( string p_strKey ) : IMod
p_strKey string The key of the mod to be retrieved.
Résultat IMod

GetModKey() public méthode

Gets the key that was assigned to the specified mod.
public GetModKey ( IMod p_modMod ) : string
p_modMod IMod The mod whose key is to be retrieved.
Résultat string

GetPreviousFileOwner() public méthode

Gets the mod that owned the specified file prior to the current owner.
public GetPreviousFileOwner ( string p_strPath ) : IMod
p_strPath string The path of the file whose previous owner is to be retrieved.
Résultat IMod

GetPreviousFileOwnerKey() public méthode

Gets the key of the mod that owned the specified file prior to the current owner.
public GetPreviousFileOwnerKey ( string p_strPath ) : string
p_strPath string The path of the file whose previous owner is to be retrieved.
Résultat string

GetPreviousGameSpecificValue() public méthode

Gets the value of the specified key before it was most recently overwritten.
public GetPreviousGameSpecificValue ( string p_strKey ) : byte[]
p_strKey string The key of the edited Game Specific Value.
Résultat byte[]

GetPreviousIniValue() public méthode

Gets the value of the specified key before it was most recently overwritten.
public GetPreviousIniValue ( string p_strSettingsFileName, string p_strSection, string p_strKey ) : string
p_strSettingsFileName string The Ini file containing the key whose previous value is to be retrieved.
p_strSection string The section containing the key whose previous value is to be retrieved.
p_strKey string The key whose previous value is to be retrieved.
Résultat string

Initialize() public static méthode

Initializes the install log.
Thrown if the install log has already /// been initialized.
public static Initialize ( ModRegistry p_mdrManagedModRegistry, string p_strModInstallDirectory, string p_strLogPath ) : IInstallLog
p_mdrManagedModRegistry ModRegistry The that contains the list /// of managed s.
p_strModInstallDirectory string The path of the directory where all of the mods are installed.
p_strLogPath string The path from which to load the install log information.
Résultat IInstallLog

IsLogValid() public static méthode

Determines if the log at the given path is valid.
public static IsLogValid ( string p_strLogPath ) : bool
p_strLogPath string The path of the log to validate.
Résultat bool

LogOriginalDataFile() public méthode

Logs that the specified data file is an original value.
Logging an original data file prepares it to be overwritten by a mod's file.
public LogOriginalDataFile ( string p_strDataFilePath ) : void
p_strDataFilePath string The path of the data file to log as an /// original value.
Résultat void

LogOriginalGameSpecificValue() public méthode

Logs that the specified Game Specific Value is an original value.
Logging an original Game Specific Value prepares it to be overwritten by a mod's value.
public LogOriginalGameSpecificValue ( string p_strKey, byte p_bteValue ) : void
p_strKey string The key of the edited Game Specific Value.
p_bteValue byte The original value.
Résultat void

LogOriginalIniValue() public méthode

Logs that the specified INI value is an original value.
Logging an original INI value prepares it to be overwritten by a mod's value.
public LogOriginalIniValue ( string p_strSettingsFileName, string p_strSection, string p_strKey, string p_strValue ) : void
p_strSettingsFileName string The name of the INI file containing the original value to log.
p_strSection string The section containting the original INI value to log.
p_strKey string The key of the original INI value to log.
p_strValue string The original value.
Résultat void

ReadVersion() public static méthode

Reads the install log verion from the given install log.
public static ReadVersion ( string p_strLogPath ) : System.Version
p_strLogPath string The install log whose version is to be read.
Résultat System.Version

Release() public méthode

This disposes of the install log, allowing it to be re-initialized.
public Release ( ) : void
Résultat void

RemoveDataFile() public méthode

Removes the specified data file as having been installed by the given mod.
public RemoveDataFile ( IMod p_modInstallingMod, string p_strDataFilePath ) : void
p_modInstallingMod IMod The mod for which to remove the specified data file.
p_strDataFilePath string The file being removed for the given mod.
Résultat void

RemoveGameSpecificValueEdit() public méthode

Removes the specified Game Specific Value edit as having been installed by the given mod.
public RemoveGameSpecificValueEdit ( IMod p_modInstallingMod, string p_strKey ) : void
p_modInstallingMod IMod The mod for which to remove the specified Game Specific Value edit.
p_strKey string The key of the Game Specific Value whose edit is being removed for the given mod.
Résultat void

RemoveIniEdit() public méthode

Removes the specified ini edit as having been installed by the given mod.
public RemoveIniEdit ( IMod p_modInstallingMod, string p_strSettingsFileName, string p_strSection, string p_strKey ) : void
p_modInstallingMod IMod The mod for which to remove the specified ini edit.
p_strSettingsFileName string The name of the edited INI file containing the INI edit being removed for the given mod.
p_strSection string The section containting the INI edit being removed for the given mod.
p_strKey string The key of the edited INI value whose edit is being removed for the given mod.
Résultat void

RemoveMod() public méthode

Removes the mod, as well as entries for items installed by the given mod, from the install log.
public RemoveMod ( IMod p_modUninstaller ) : void
p_modUninstaller IMod The mod to remove.
Résultat void

ReplaceActiveMod() public méthode

Replaces a mod in the install log, in a transaction.
This replaces a mod in the install log without changing its key.
public ReplaceActiveMod ( IMod p_modOldMod, IMod p_modNewMod ) : void
p_modOldMod IMod The mod with to be replaced with the new mod in the install log.
p_modNewMod IMod The mod with which to replace the old mod in the install log.
Résultat void

ReplaceGameSpecificValueEdit() public méthode

Replaces the edited value of the specified game specific value edit installed by the given mod.
public ReplaceGameSpecificValueEdit ( IMod p_modInstallingMod, string p_strKey, byte p_bteValue ) : void
p_modInstallingMod IMod The mod whose game specific value edit value is to be replaced.
p_strKey string The key of the game spcified value whose edited value is to be replaced.
p_bteValue byte The value with which to replace the edited value of the specified game specific value edit installed by the given mod.
Résultat void

ReplaceIniEdit() public méthode

Replaces the edited value of the specified INI edit installed by the given mod.
public ReplaceIniEdit ( IMod p_modInstallingMod, string p_strSettingsFileName, string p_strSection, string p_strKey, string p_strValue ) : void
p_modInstallingMod IMod The mod whose INI edit value is to be replaced.
p_strSettingsFileName string The name of the Ini value whose edited value is to be replaced.
p_strSection string The section of the Ini value whose edited value is to be replaced.
p_strKey string The key of the Ini value whose edited value is to be replaced.
p_strValue string The value with which to replace the edited value of the specified INI edit installed by the given mod.
Résultat void

Restore() public static méthode

This restores the first valid backup of the install log.
public static Restore ( string p_strLogPath ) : bool
p_strLogPath string
Résultat bool

SaveInstallLog() protected méthode

Save the data to the Install Log file.
protected SaveInstallLog ( ) : void
Résultat void