/// <summary> /// Loads the user's settings into the control. /// </summary> public override void Load() { string strBOSSPath = String.Empty; string strBOSSReg = String.Empty; string strWryePath = String.Empty; if (IntPtr.Size == 8) { strBOSSReg = @"HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\BOSS\"; } else { strBOSSReg = @"HKEY_LOCAL_MACHINE\SOFTWARE\BOSS\"; } if (EnvironmentInfo.Settings.SupportedTools[GameModeDescriptor.ModeId].ContainsKey("BOSS")) { strBOSSPath = EnvironmentInfo.Settings.SupportedTools[GameModeDescriptor.ModeId]["BOSS"]; } if (String.IsNullOrEmpty(strBOSSPath)) { if (RegistryUtil.CanReadKey(strBOSSReg)) { string strRegPath = (string)Registry.GetValue(strBOSSReg, "Installed Path", null); if (!String.IsNullOrWhiteSpace(strRegPath) && ((strRegPath.IndexOfAny(Path.GetInvalidPathChars()) >= 0) || !Directory.Exists(strRegPath))) { strBOSSPath = String.Empty; EnvironmentInfo.Settings.SupportedTools[GameModeDescriptor.ModeId]["BOSS"] = strBOSSPath; EnvironmentInfo.Settings.Save(); } else { strBOSSPath = strRegPath; } } } if (!String.IsNullOrEmpty(strBOSSPath) && Directory.Exists(strBOSSPath)) { BOSSDirectory = strBOSSPath; } if (EnvironmentInfo.Settings.SupportedTools[GameModeDescriptor.ModeId].ContainsKey("WryeBash")) { strWryePath = EnvironmentInfo.Settings.SupportedTools[GameModeDescriptor.ModeId]["WryeBash"]; if (!String.IsNullOrEmpty(strWryePath) && Directory.Exists(strWryePath)) { WryeBashDirectory = strWryePath; } } ValidateSettings(); }
/// <summary> /// Gets the LOOT launch command. /// </summary> /// <returns>The LOOT launch command.</returns> private string GetLOOTLaunchCommand() { var strLOOT = string.Empty; var strRegLOOT = string.Empty; if (IntPtr.Size == 8) { strRegLOOT = @"HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\LOOT\"; } else { strRegLOOT = @"HKEY_LOCAL_MACHINE\SOFTWARE\LOOT\"; } if (EnvironmentInfo.Settings.SupportedTools.ContainsKey(GameMode.ModeId) && EnvironmentInfo.Settings.SupportedTools[GameMode.ModeId].ContainsKey("LOOT")) { strLOOT = EnvironmentInfo.Settings.SupportedTools[GameMode.ModeId]["LOOT"]; if (!string.IsNullOrWhiteSpace(strLOOT) && ((strLOOT.IndexOfAny(Path.GetInvalidPathChars()) >= 0) || !Directory.Exists(strLOOT))) { strLOOT = string.Empty; EnvironmentInfo.Settings.SupportedTools[GameMode.ModeId]["LOOT"] = string.Empty; EnvironmentInfo.Settings.Save(); } } if (string.IsNullOrEmpty(strLOOT)) { if (RegistryUtil.CanReadKey(strRegLOOT)) { var strRegPath = (string)Registry.GetValue(strRegLOOT, "Installed Path", null); if (!string.IsNullOrWhiteSpace(strRegPath) && ((strRegPath.IndexOfAny(Path.GetInvalidPathChars()) >= 0) || !Directory.Exists(strRegPath))) { strLOOT = string.Empty; EnvironmentInfo.Settings.SupportedTools[GameMode.ModeId]["LOOT"] = strLOOT; EnvironmentInfo.Settings.Save(); } else { strLOOT = strRegPath; } } } if (!string.IsNullOrWhiteSpace(strLOOT)) { strLOOT = Path.Combine(strLOOT, "LOOT.exe"); } return(strLOOT); }
/// <summary> /// Gets the BOSS launch command. /// </summary> /// <returns>The BOSS launch command.</returns> private string GetBOSSLaunchCommand() { string strBOSS = string.Empty; string strRegBoss = string.Empty; if (IntPtr.Size == 8) { strRegBoss = @"HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\BOSS\"; } else { strRegBoss = @"HKEY_LOCAL_MACHINE\SOFTWARE\BOSS\"; } if (EnvironmentInfo.Settings.SupportedTools.ContainsKey(GameMode.ModeId) && EnvironmentInfo.Settings.SupportedTools[GameMode.ModeId].ContainsKey("BOSS")) { strBOSS = EnvironmentInfo.Settings.SupportedTools[GameMode.ModeId]["BOSS"]; if (!string.IsNullOrWhiteSpace(strBOSS) && ((strBOSS.IndexOfAny(Path.GetInvalidPathChars()) >= 0) || !Directory.Exists(strBOSS))) { strBOSS = string.Empty; EnvironmentInfo.Settings.SupportedTools[GameMode.ModeId]["BOSS"] = string.Empty; EnvironmentInfo.Settings.Save(); } } if (string.IsNullOrEmpty(strBOSS)) { if (RegistryUtil.CanReadKey(strRegBoss)) { string strRegPath = (string)Registry.GetValue(strRegBoss, "Installed Path", null); if (!String.IsNullOrWhiteSpace(strRegPath) && ((strRegPath.IndexOfAny(Path.GetInvalidPathChars()) >= 0) || !Directory.Exists(strRegPath))) { strBOSS = string.Empty; EnvironmentInfo.Settings.SupportedTools[GameMode.ModeId]["BOSS"] = strBOSS; EnvironmentInfo.Settings.Save(); } else { strBOSS = strRegPath; } } } if (!string.IsNullOrWhiteSpace(strBOSS)) { strBOSS = Path.Combine(strBOSS, "boss.exe"); } return(strBOSS); }
/// <summary> /// Check the correct path on the Registry. /// </summary> /// <param name="strGameMode">The selected game mode.</param> /// <param name="strMods">The selected Mods path.</param> /// <param name="strInstallInfo">The selected Install Info path.</param> public void SaveRegistry(string p_strGameMode, string p_strMods, string p_strInstallInfo, string p_strVirtual, string p_strHDLink, bool p_booMultiHDInstall) { try { var strGameKey = RegistryLocation + p_strGameMode; RegistryKey rkKey = null; if (RegistryUtil.CanReadKey(RegistryLocation) && RegistryUtil.CanWriteKey(RegistryLocation)) { //This will create the key if it doesn't exist, if it does exist it opens it rkKey = Registry.LocalMachine.CreateSubKey(RegistryLocation); } if (rkKey == null) { return; } if (RegistryUtil.CanCreateKey(strGameKey)) { Registry.LocalMachine.CreateSubKey(strGameKey); } if (!RegistryUtil.CanReadKey(strGameKey) || !RegistryUtil.CanWriteKey(strGameKey)) { return; } rkKey = Registry.LocalMachine.OpenSubKey(strGameKey, true); rkKey.SetValue("Mods", p_strMods); rkKey.SetValue("InstallInfo", p_strInstallInfo); rkKey.SetValue("Virtual", p_strVirtual); rkKey.SetValue("MultiHDInstall", p_booMultiHDInstall); //This parameter can actually be null sometimes if (!string.IsNullOrWhiteSpace(p_strHDLink)) { rkKey.SetValue("HDLink", p_strHDLink); } } catch { //Why is this not being logged? return; } }
/// <summary> /// Check the correct path on the Registry. /// </summary> /// <param name="strGameMode">The selected game mode.</param> /// <param name="strMods">The selected Mods path.</param> /// <param name="strInstallInfo">The selected Install Info path.</param> public void SaveRegistry(string p_strGameMode, string p_strMods, string p_strInstallInfo, string p_strVirtual, string p_strHDLink, bool p_booMultiHDInstall) { try { RegistryKey rkKey = null; string strNMMKey = @"HKEY_LOCAL_MACHINE\SOFTWARE\NexusModManager\"; string strGameKey = @"HKEY_LOCAL_MACHINE\SOFTWARE\NexusModManager\" + p_strGameMode; if (RegistryUtil.CanReadKey(strNMMKey) && RegistryUtil.CanWriteKey(strNMMKey)) { rkKey = Registry.LocalMachine.OpenSubKey(strNMMKey, true); if (rkKey == null) { if (RegistryUtil.CanCreateKey(strNMMKey)) { Registry.LocalMachine.CreateSubKey(strNMMKey); } } } if (rkKey != null) { if (RegistryUtil.CanCreateKey(strGameKey)) { Registry.LocalMachine.CreateSubKey(strGameKey); } if (RegistryUtil.CanReadKey(strGameKey) && RegistryUtil.CanWriteKey(strGameKey)) { rkKey = Registry.LocalMachine.OpenSubKey(strGameKey, true); rkKey.SetValue("Mods", p_strMods); rkKey.SetValue("InstallInfo", p_strInstallInfo); rkKey.SetValue("Virtual", p_strVirtual); rkKey.SetValue("HDLink", p_strHDLink); rkKey.SetValue("MultiHDInstall", p_booMultiHDInstall); } } } catch { return; } }
/// <summary> /// Check the correct path on the Registry. /// </summary> /// <param name="strGameMode">The selected game mode.</param> /// <param name="strMods">The selected Mods path.</param> /// <param name="strInstallInfo">The selected Install Info path.</param> public void SaveRegistry(string strGameMode, string strMods, string strInstallInfo) { try { RegistryKey rkKey = null; string strNMMKey = @"SOFTWARE\NexusModManager\"; string strGameKey = @"SOFTWARE\NexusModManager\" + strGameMode; if (RegistryUtil.CanReadKey(strNMMKey) && RegistryUtil.CanWriteKey(strNMMKey)) { rkKey = Registry.LocalMachine.OpenSubKey(strNMMKey, true); if (rkKey == null) { if (RegistryUtil.CanCreateKey(strNMMKey)) { Registry.LocalMachine.CreateSubKey(strNMMKey); } } } if (rkKey != null) { if (RegistryUtil.CanCreateKey(strGameKey)) { Registry.LocalMachine.CreateSubKey(strGameKey); } if (RegistryUtil.CanReadKey(strGameKey) && RegistryUtil.CanWriteKey(strGameKey)) { rkKey = Registry.LocalMachine.OpenSubKey(strGameKey, true); rkKey.SetValue("Mods", strMods); rkKey.SetValue("InstallInfo", strInstallInfo); } } } catch { return; } }
/// <summary> /// Loads the user's settings into the control. /// </summary> public void LoadSettings() { string strRegGameMode = RegistryLocation + GameModeDescriptor.ModeId; string strRegMods = String.Empty; string strRegInstallInfo = String.Empty; string strRegVirtual = String.Empty; string strRegHDLink = String.Empty; bool? booRegMultiHDInstall = null; if (RegistryUtil.CanReadKey(strRegGameMode)) { RegistryKey rkKey = Registry.LocalMachine.OpenSubKey(strRegGameMode, false); if (rkKey != null) { strRegMods = (string)rkKey.GetValue("Mods", null); strRegInstallInfo = (string)rkKey.GetValue("InstallInfo", null); strRegVirtual = (string)rkKey.GetValue("Virtual", null); strRegHDLink = (string)rkKey.GetValue("HDLink", null); booRegMultiHDInstall = (bool?)rkKey.GetValue("MultiHDInstall", null); } } string strInstallationPath = EnvironmentInfo.Settings.InstallationPaths[GameModeDescriptor.ModeId]; if (string.IsNullOrWhiteSpace(strInstallationPath)) { strInstallationPath = Application.ExecutablePath; } string strDirectory = null; string strRandomGameKey = String.Empty; bool booRetrieved = false; if (EnvironmentInfo.Settings.ModFolder.ContainsKey(GameModeDescriptor.ModeId) && !String.IsNullOrEmpty(EnvironmentInfo.Settings.ModFolder[GameModeDescriptor.ModeId])) { ModDirectory = EnvironmentInfo.Settings.ModFolder[GameModeDescriptor.ModeId]; } else if (!String.IsNullOrEmpty(strRegMods)) { ModDirectory = strRegMods; } else if (EnvironmentInfo.Settings.ModFolder.Keys.Count > 0) { strRandomGameKey = EnvironmentInfo.Settings.ModFolder.FirstOrDefault().Key; if (!String.IsNullOrEmpty(strRandomGameKey)) { strRegMods = EnvironmentInfo.Settings.ModFolder[strRandomGameKey]; } if (!String.IsNullOrEmpty(strRegMods)) { try { if (strRegMods.IndexOf(strRandomGameKey) >= 0) { ModDirectory = strRegMods.Replace(strRandomGameKey, GameModeDescriptor.ModeId); } else { ModDirectory = strRegMods.Replace(Path.GetFileName(strRegMods), GameModeDescriptor.ModeId + Path.DirectorySeparatorChar + Path.GetFileName(strRegMods)); } } catch { } } } if (string.IsNullOrEmpty(ModDirectory)) { if (EnvironmentInfo.Settings.DelayedSettings.ContainsKey(GameModeDescriptor.ModeId)) { booRetrieved = EnvironmentInfo.Settings.DelayedSettings[GameModeDescriptor.ModeId].TryGetValue(String.Format("ModFolder~{0}", GameModeDescriptor.ModeId), out strDirectory); } if (!booRetrieved) { EnvironmentInfo.Settings.ModFolder.TryGetValue(GameModeDescriptor.ModeId, out strDirectory); } if (String.IsNullOrEmpty(strDirectory)) { string strDefault = Path.Combine(Path.GetPathRoot(strInstallationPath), "Games", EnvironmentInfo.Settings.ModManagerName, GameModeDescriptor.ModeId, "Mods"); strDirectory = strDefault; } ModDirectory = strDirectory; } if (EnvironmentInfo.Settings.InstallInfoFolder.ContainsKey(GameModeDescriptor.ModeId) && !String.IsNullOrEmpty(EnvironmentInfo.Settings.InstallInfoFolder[GameModeDescriptor.ModeId])) { InstallInfoDirectory = EnvironmentInfo.Settings.InstallInfoFolder[GameModeDescriptor.ModeId]; } else if (!String.IsNullOrEmpty(strRegInstallInfo)) { InstallInfoDirectory = strRegInstallInfo; } else if (EnvironmentInfo.Settings.ModFolder.Keys.Count > 0) { strRandomGameKey = EnvironmentInfo.Settings.InstallInfoFolder.FirstOrDefault().Key; if (String.IsNullOrEmpty(strRandomGameKey)) { strRegInstallInfo = EnvironmentInfo.Settings.InstallInfoFolder[strRandomGameKey]; } if (!String.IsNullOrEmpty(strRegInstallInfo)) { try { if (strRegInstallInfo.IndexOf(strRandomGameKey) >= 0) { InstallInfoDirectory = strRegInstallInfo.Replace(strRandomGameKey, GameModeDescriptor.ModeId); } else { InstallInfoDirectory = strRegInstallInfo.Replace(Path.GetFileName(strRegInstallInfo), GameModeDescriptor.ModeId + Path.DirectorySeparatorChar + Path.GetFileName(strRegInstallInfo)); } } catch { } } } if (String.IsNullOrEmpty(InstallInfoDirectory)) { strDirectory = null; booRetrieved = false; if (EnvironmentInfo.Settings.DelayedSettings.ContainsKey(GameModeDescriptor.ModeId)) { booRetrieved = EnvironmentInfo.Settings.DelayedSettings[GameModeDescriptor.ModeId].TryGetValue(String.Format("InstallInfoFolder~{0}", GameModeDescriptor.ModeId), out strDirectory); } if (!booRetrieved) { EnvironmentInfo.Settings.InstallInfoFolder.TryGetValue(GameModeDescriptor.ModeId, out strDirectory); } if (String.IsNullOrEmpty(strDirectory)) { string strDefault = Path.Combine(Path.GetPathRoot(strInstallationPath), "Games", EnvironmentInfo.Settings.ModManagerName, GameModeDescriptor.ModeId, "Install Info"); strDirectory = strDefault; } InstallInfoDirectory = strDirectory; } if (m_booRequiredTool) { if (EnvironmentInfo.Settings.ToolFolder.ContainsKey(GameModeDescriptor.ModeId)) { ToolDirectory = EnvironmentInfo.Settings.ToolFolder[GameModeDescriptor.ModeId]; } if (string.IsNullOrEmpty(ToolDirectory)) { strDirectory = null; booRetrieved = false; foreach (string ToolFile in GameModeDescriptor.OrderedRequiredToolFileNames) { if (File.Exists(ToolFile)) { booRetrieved = true; } else { booRetrieved = false; break; } } if (booRetrieved) { strDirectory = Path.GetDirectoryName(GameModeDescriptor.OrderedRequiredToolFileNames[0]); } if (!String.IsNullOrEmpty(strDirectory)) { ToolDirectory = strDirectory; } } } if (EnvironmentInfo.Settings.MultiHDInstall.ContainsKey(GameModeDescriptor.ModeId)) { MultiHDInstall = EnvironmentInfo.Settings.MultiHDInstall[GameModeDescriptor.ModeId]; } else if (booRegMultiHDInstall != null) { MultiHDInstall = (bool)booRegMultiHDInstall; } if (booRegMultiHDInstall == null) { if (EnvironmentInfo.Settings.DelayedSettings.ContainsKey(GameModeDescriptor.ModeId)) { booRetrieved = EnvironmentInfo.Settings.DelayedSettings[GameModeDescriptor.ModeId].TryGetValue(String.Format("MultiHDInstall~{0}", GameModeDescriptor.ModeId), out strDirectory); } if (booRetrieved) { booRegMultiHDInstall = Convert.ToBoolean(strDirectory); } if (booRegMultiHDInstall == null) { booRegMultiHDInstall = false; } MultiHDInstall = (bool)booRegMultiHDInstall; } if (EnvironmentInfo.Settings.VirtualFolder.ContainsKey(GameModeDescriptor.ModeId) && !String.IsNullOrEmpty(EnvironmentInfo.Settings.VirtualFolder[GameModeDescriptor.ModeId])) { VirtualDirectory = EnvironmentInfo.Settings.VirtualFolder[GameModeDescriptor.ModeId]; } else if (!String.IsNullOrEmpty(strRegVirtual)) { VirtualDirectory = strRegVirtual; } if (string.IsNullOrEmpty(VirtualDirectory) || (!MultiHDInstall && (!CheckOnGameHD(VirtualDirectory)))) { if (EnvironmentInfo.Settings.DelayedSettings.ContainsKey(GameModeDescriptor.ModeId)) { booRetrieved = EnvironmentInfo.Settings.DelayedSettings[GameModeDescriptor.ModeId].TryGetValue(String.Format("VirtualFolder~{0}", GameModeDescriptor.ModeId), out strDirectory); } if (!booRetrieved) { EnvironmentInfo.Settings.VirtualFolder.TryGetValue(GameModeDescriptor.ModeId, out strDirectory); } if (String.IsNullOrEmpty(strDirectory)) { string strDefault = String.Empty; strDefault = ModDirectory; if (!MultiHDInstall && (!CheckOnGameHD(strDefault))) { strDefault = Path.Combine(((m_booRequiredTool ? Path.GetPathRoot(ToolDirectory) : Path.GetPathRoot(GameModeDescriptor.InstallationPath)) ?? Path.GetPathRoot(Application.ExecutablePath)), "Games", EnvironmentInfo.Settings.ModManagerName, GameModeDescriptor.ModeId); } strDirectory = strDefault; } VirtualDirectory = strDirectory; } if (MultiHDInstall) { if (EnvironmentInfo.Settings.HDLinkFolder.ContainsKey(GameModeDescriptor.ModeId) && !String.IsNullOrEmpty(EnvironmentInfo.Settings.HDLinkFolder[GameModeDescriptor.ModeId])) { LinkDirectory = EnvironmentInfo.Settings.HDLinkFolder[GameModeDescriptor.ModeId]; } else if (!String.IsNullOrEmpty(strRegHDLink)) { LinkDirectory = strRegHDLink; } if (string.IsNullOrEmpty(LinkDirectory) || !CheckOnGameHD(LinkDirectory)) { if (EnvironmentInfo.Settings.DelayedSettings.ContainsKey(GameModeDescriptor.ModeId)) { booRetrieved = EnvironmentInfo.Settings.DelayedSettings[GameModeDescriptor.ModeId].TryGetValue(String.Format("LinkFolder~{0}", GameModeDescriptor.ModeId), out strDirectory); } if (!booRetrieved) { EnvironmentInfo.Settings.HDLinkFolder.TryGetValue(GameModeDescriptor.ModeId, out strDirectory); } if (String.IsNullOrEmpty(strDirectory) || !CheckOnGameHD(strDirectory)) { strDirectory = Path.Combine(Path.GetPathRoot(GameModeDescriptor.InstallationPath ?? Path.GetPathRoot(Application.ExecutablePath)), "Games", EnvironmentInfo.Settings.ModManagerName, GameModeDescriptor.ModeId); } LinkDirectory = strDirectory; } } ValidateSettings(); }
/// <summary> /// Loads the user's settings into the control. /// </summary> public override void Load() { string strBOSSPath = String.Empty; string strBOSSReg = String.Empty; string strLOOTPath = String.Empty; string strLOOTReg = String.Empty; string strWryePath = String.Empty; string strFNISPath = String.Empty; string strBSPath = String.Empty; string strDSRPPath = String.Empty; string strPMPath = String.Empty; string strTES5EditPath = String.Empty; bool booReset = false; if (IntPtr.Size == 8) { strBOSSReg = @"HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\BOSS\"; } else { strBOSSReg = @"HKEY_LOCAL_MACHINE\SOFTWARE\BOSS\"; } if (EnvironmentInfo.Settings.SupportedTools[GameModeDescriptor.ModeId].ContainsKey("BOSS")) { strBOSSPath = EnvironmentInfo.Settings.SupportedTools[GameModeDescriptor.ModeId]["BOSS"]; } if (String.IsNullOrEmpty(strBOSSPath)) { if (RegistryUtil.CanReadKey(strBOSSReg)) { string strRegPath = (string)Registry.GetValue(strBOSSReg, "Installed Path", null); if (!String.IsNullOrWhiteSpace(strRegPath) && ((strRegPath.IndexOfAny(Path.GetInvalidPathChars()) >= 0) || !Directory.Exists(strRegPath))) { strBOSSPath = String.Empty; EnvironmentInfo.Settings.SupportedTools[GameModeDescriptor.ModeId]["BOSS"] = strBOSSPath; EnvironmentInfo.Settings.Save(); } else { strBOSSPath = strRegPath; } } } if (!String.IsNullOrEmpty(strBOSSPath) && Directory.Exists(strBOSSPath)) { BOSSDirectory = strBOSSPath; } if (IntPtr.Size == 8) { strLOOTReg = @"HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\LOOT\"; } else { strLOOTReg = @"HKEY_LOCAL_MACHINE\SOFTWARE\LOOT\"; } if (EnvironmentInfo.Settings.SupportedTools[GameModeDescriptor.ModeId].ContainsKey("LOOT")) { strLOOTPath = EnvironmentInfo.Settings.SupportedTools[GameModeDescriptor.ModeId]["LOOT"]; } if (String.IsNullOrEmpty(strLOOTPath)) { if (RegistryUtil.CanReadKey(strLOOTReg)) { string strRegPath = (string)Registry.GetValue(strLOOTReg, "Installed Path", null); if (!String.IsNullOrWhiteSpace(strRegPath) && ((strRegPath.IndexOfAny(Path.GetInvalidPathChars()) >= 0) || !Directory.Exists(strRegPath))) { strLOOTPath = String.Empty; EnvironmentInfo.Settings.SupportedTools[GameModeDescriptor.ModeId]["LOOT"] = strLOOTPath; EnvironmentInfo.Settings.Save(); } else { strLOOTPath = strRegPath; } } } if (!String.IsNullOrEmpty(strLOOTPath) && Directory.Exists(strLOOTPath)) { LOOTDirectory = strLOOTPath; } if (EnvironmentInfo.Settings.SupportedTools[GameModeDescriptor.ModeId].ContainsKey("WryeBash")) { strWryePath = EnvironmentInfo.Settings.SupportedTools[GameModeDescriptor.ModeId]["WryeBash"]; if (!String.IsNullOrEmpty(strWryePath) && Directory.Exists(strWryePath)) { WryeBashDirectory = strWryePath; } } if (EnvironmentInfo.Settings.SupportedTools[GameModeDescriptor.ModeId].ContainsKey("FNIS")) { strFNISPath = EnvironmentInfo.Settings.SupportedTools[GameModeDescriptor.ModeId]["FNIS"]; if (String.IsNullOrEmpty(strFNISPath)) { booReset = true; } else if (Directory.Exists(strFNISPath) || File.Exists(strFNISPath)) { FileAttributes attr = File.GetAttributes(strFNISPath); booReset = !attr.HasFlag(FileAttributes.Directory); } else { booReset = true; } if (booReset) { string strFNIS = Path.Combine(GameModeDescriptor.InstallationPath, @"Data\tools\GenerateFNIS_for_Users"); if (Directory.Exists(strFNIS)) { strFNISPath = strFNIS; } else { strFNISPath = String.Empty; } booReset = false; } if (!String.IsNullOrEmpty(strFNISPath) && Directory.Exists(strFNISPath)) { FNISDirectory = strFNISPath; } } if (EnvironmentInfo.Settings.SupportedTools[GameModeDescriptor.ModeId].ContainsKey("BS2")) { strBSPath = EnvironmentInfo.Settings.SupportedTools[GameModeDescriptor.ModeId]["BS2"]; if (String.IsNullOrEmpty(strBSPath)) { booReset = true; } else if (Directory.Exists(strBSPath) || File.Exists(strBSPath)) { FileAttributes attr = File.GetAttributes(strBSPath); booReset = !attr.HasFlag(FileAttributes.Directory); } else { booReset = true; } if (booReset) { string strBS = Path.Combine(GameModeDescriptor.InstallationPath, @"Data\CalienteTools\BodySlide"); if (Directory.Exists(strBS)) { strBSPath = strBS; } else { strBSPath = String.Empty; } booReset = false; } if (!String.IsNullOrEmpty(strBSPath) && Directory.Exists(strBSPath)) { BSDirectory = strBSPath; } } if (EnvironmentInfo.Settings.SupportedTools[GameModeDescriptor.ModeId].ContainsKey("DSRP")) { strDSRPPath = EnvironmentInfo.Settings.SupportedTools[GameModeDescriptor.ModeId]["DSRP"]; if (String.IsNullOrEmpty(strDSRPPath)) { booReset = true; } else if (Directory.Exists(strDSRPPath) || File.Exists(strDSRPPath)) { FileAttributes attr = File.GetAttributes(strDSRPPath); booReset = !attr.HasFlag(FileAttributes.Directory); } else { booReset = true; } if (booReset) { string strDSRP = Path.Combine(GameModeDescriptor.InstallationPath, @"Data\SkyProc Patchers\T3nd0_PatchusMaximus"); if (Directory.Exists(strDSRP)) { strDSRPPath = strDSRP; } else { strDSRPPath = String.Empty; } booReset = false; } if (!String.IsNullOrEmpty(strDSRPPath) && Directory.Exists(strDSRPPath)) { DSRPDirectory = strDSRPPath; } } if (EnvironmentInfo.Settings.SupportedTools[GameModeDescriptor.ModeId].ContainsKey("PM")) { strPMPath = EnvironmentInfo.Settings.SupportedTools[GameModeDescriptor.ModeId]["PM"]; if (String.IsNullOrEmpty(strPMPath)) { booReset = true; } else if (Directory.Exists(strPMPath) || File.Exists(strPMPath)) { FileAttributes attr = File.GetAttributes(strPMPath); booReset = !attr.HasFlag(FileAttributes.Directory); } else { booReset = true; } if (booReset) { string strPM = Path.Combine(GameModeDescriptor.InstallationPath, @"Data\SkyProc Patchers\Dual Sheath Redux Patch"); if (Directory.Exists(strPM)) { strPMPath = strPM; } else { strPMPath = String.Empty; } booReset = false; } if (!String.IsNullOrEmpty(strPMPath) && Directory.Exists(strPMPath)) { PMDirectory = strPMPath; } } if (EnvironmentInfo.Settings.SupportedTools[GameModeDescriptor.ModeId].ContainsKey("TES5Edit")) { strTES5EditPath = EnvironmentInfo.Settings.SupportedTools[GameModeDescriptor.ModeId]["TES5Edit"]; if (!String.IsNullOrEmpty(strTES5EditPath) && Directory.Exists(strTES5EditPath)) { TES5EditDirectory = strTES5EditPath; } } ValidateSettings(); }