/// <summary> /// A simple constructor that initializes the object with its dependencies. /// </summary> /// <param name="p_gmiGameModeInfo">The environment info of the current game mode.</param> /// <param name="p_modMod">The mod being installed.</param> /// <param name="p_ilgInstallLog">The install log to use to log file installations.</param> /// <param name="p_pmgPluginManager">The plugin manager.</param> /// <param name="p_dfuDataFileUtility">The utility class to use to work with data files.</param> /// <param name="p_tfmFileManager">The transactional file manager to use to interact with the file system.</param> /// <param name="p_dlgOverwriteConfirmationDelegate">The method to call in order to confirm an overwrite.</param> /// <param name="p_UsesPlugins">Game using plugin or mods (True for plugins).</param> public ModFileUpgradeInstaller(IGameModeEnvironmentInfo p_gmiGameModeInfo, IMod p_modMod, IInstallLog p_ilgInstallLog, IPluginManager p_pmgPluginManager, IDataFileUtil p_dfuDataFileUtility, TxFileManager p_tfmFileManager, ConfirmItemOverwriteDelegate p_dlgOverwriteConfirmationDelegate, bool p_UsesPlugins) : base(p_gmiGameModeInfo, p_modMod, p_ilgInstallLog, p_pmgPluginManager, p_dfuDataFileUtility, p_tfmFileManager, p_dlgOverwriteConfirmationDelegate, p_UsesPlugins, null) { OriginallyInstalledFiles = new Set<string>(StringComparer.OrdinalIgnoreCase); foreach (string strFile in InstallLog.GetInstalledModFiles(Mod)) OriginallyInstalledFiles.Add(strFile.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar)); }
/// <summary> /// A sinmple constructor that initializes the object with the given values. /// </summary> /// <param name="p_dfuDataFileUtility">The utility class to use to work with data files.</param> /// <param name="p_mfiFileInstaller">The installer to use to install files.</param> /// <param name="p_iniIniInstaller">The installer to use to install INI values.</param> /// <param name="p_gviGameSpecificValueInstaller">The installer to use to install game specific values.</param> /// <param name="p_pmgPluginManager">The manager to use to manage plugins.</param> public InstallerGroup(IDataFileUtil p_dfuDataFileUtility, IModFileInstaller p_mfiFileInstaller, IIniInstaller p_iniIniInstaller, IGameSpecificValueInstaller p_gviGameSpecificValueInstaller, IPluginManager p_pmgPluginManager) { DataFileUtility = p_dfuDataFileUtility; FileInstaller = p_mfiFileInstaller; IniInstaller = p_iniIniInstaller; GameSpecificValueInstaller = p_gviGameSpecificValueInstaller; PluginManager = p_pmgPluginManager; }
/// <summary> /// A simple constructor that initializes the object with its dependencies. /// </summary> /// <param name="p_gmiGameModeInfo">The environment info of the current game mode.</param> /// <param name="p_modMod">The mod being installed.</param> /// <param name="p_ilgInstallLog">The install log to use to log file installations.</param> /// <param name="p_pmgPluginManager">The plugin manager.</param> /// <param name="p_dfuDataFileUtility">The utility class to use to work with data files.</param> /// <param name="p_tfmFileManager">The transactional file manager to use to interact with the file system.</param> /// <param name="p_dlgOverwriteConfirmationDelegate">The method to call in order to confirm an overwrite.</param> /// <param name="p_UsesPlugins">Whether the file is a mod or a plugin.</param> public ModFileInstaller(IGameModeEnvironmentInfo p_gmiGameModeInfo, IMod p_modMod, IInstallLog p_ilgInstallLog, IPluginManager p_pmgPluginManager, IDataFileUtil p_dfuDataFileUtility, TxFileManager p_tfmFileManager, ConfirmItemOverwriteDelegate p_dlgOverwriteConfirmationDelegate, bool p_UsesPlugins) { GameModeInfo = p_gmiGameModeInfo; Mod = p_modMod; InstallLog = p_ilgInstallLog; PluginManager = p_pmgPluginManager; DataFileUtility = p_dfuDataFileUtility; TransactionalFileManager = p_tfmFileManager; m_dlgOverwriteConfirmationDelegate = p_dlgOverwriteConfirmationDelegate ?? ((s, b, m) => OverwriteResult.No); IsPlugin = p_UsesPlugins; }
/// <summary> /// A simple constructor that initializes the object with its dependencies. /// </summary> /// <param name="p_gmiGameModeInfo">The environment info of the current game mode.</param> /// <param name="p_modMod">The mod being installed.</param> /// <param name="p_ilgInstallLog">The install log to use to log file installations.</param> /// <param name="p_pmgPluginManager">The plugin manager.</param> /// <param name="p_dfuDataFileUtility">The utility class to use to work with data files.</param> /// <param name="p_tfmFileManager">The transactional file manager to use to interact with the file system.</param> /// <param name="p_dlgOverwriteConfirmationDelegate">The method to call in order to confirm an overwrite.</param> /// <param name="p_UsesPlugins">Whether the file is a mod or a plugin.</param> public ModFileInstaller(IGameModeEnvironmentInfo p_gmiGameModeInfo, IMod p_modMod, IInstallLog p_ilgInstallLog, IPluginManager p_pmgPluginManager, IDataFileUtil p_dfuDataFileUtility, TxFileManager p_tfmFileManager, ConfirmItemOverwriteDelegate p_dlgOverwriteConfirmationDelegate, bool p_UsesPlugins, string p_extractPath, IEnumerable <string> p_stopFolders) { GameModeInfo = p_gmiGameModeInfo; Mod = p_modMod; InstallLog = p_ilgInstallLog; PluginManager = p_pmgPluginManager; DataFileUtility = p_dfuDataFileUtility; TransactionalFileManager = p_tfmFileManager; TargetFiles = new Dictionary <string, ArchiveFileInfo>(); m_dlgOverwriteConfirmationDelegate = p_dlgOverwriteConfirmationDelegate ?? ((s, b, m) => OverwriteResult.No); IsPlugin = p_UsesPlugins; ExtractPath = p_extractPath; StopFolders = new List <string>(p_stopFolders); if (!StopFolders.Contains("fomod", StringComparer.OrdinalIgnoreCase)) { StopFolders.Add("fomod"); } Archive archive = new Archive(Mod.ModArchivePath); Prefix = FindPathPrefix(archive); m_dicFileInfo = new Dictionary <string, ArchiveFileInfo>(StringComparer.OrdinalIgnoreCase); m_strFiles = new List <string>(); LoadFileIndices(); }
/// <summary> /// A simple constructor that initializes the object with its dependencies. /// </summary> /// <param name="p_gmiGameModeInfo">The environment info of the current game mode.</param> /// <param name="p_modMod">The mod being installed.</param> /// <param name="p_ilgInstallLog">The install log to use to log file installations.</param> /// <param name="p_pmgPluginManager">The plugin manager.</param> /// <param name="p_dfuDataFileUtility">The utility class to use to work with data files.</param> /// <param name="p_tfmFileManager">The transactional file manager to use to interact with the file system.</param> /// <param name="p_dlgOverwriteConfirmationDelegate">The method to call in order to confirm an overwrite.</param> /// <param name="p_UsesPlugins">Game using plugin or mods (True for plugins).</param> public ModFileUpgradeInstaller(IGameModeEnvironmentInfo p_gmiGameModeInfo, IMod p_modMod, IInstallLog p_ilgInstallLog, IPluginManager p_pmgPluginManager, IDataFileUtil p_dfuDataFileUtility, TxFileManager p_tfmFileManager, ConfirmItemOverwriteDelegate p_dlgOverwriteConfirmationDelegate, bool p_UsesPlugins) : base(p_gmiGameModeInfo, p_modMod, p_ilgInstallLog, p_pmgPluginManager, p_dfuDataFileUtility, p_tfmFileManager, p_dlgOverwriteConfirmationDelegate, p_UsesPlugins, null) { OriginallyInstalledFiles = new Set <string>(StringComparer.OrdinalIgnoreCase); foreach (string strFile in InstallLog.GetInstalledModFiles(Mod)) { OriginallyInstalledFiles.Add(strFile.Replace(Path.AltDirectorySeparatorChar, Path.DirectorySeparatorChar)); } }