public static string Mod() { // Location for mod VistaFolderBrowserDialog mod = new VistaFolderBrowserDialog() { Description = "Select a mod folder...", UseDescriptionForTitle = true }; if (mod.ShowDialog() == DialogResult.OK) { string config = Path.Combine(mod.SelectedPath, "mod.ini"); if (File.Exists(config)) { string system = INI.DeserialiseKey("Platform", config); foreach (string file in Paths.CollectModData(mod.SelectedPath)) { // Absolute file path (core/xenon/win32 and beyond) string filePath = Literal.CoreReplace(file.Remove(0, mod.SelectedPath.Length).Substring(1)); // Absolute file path (from the mod) combined with the game directory string vanillaFilePath = Path.Combine(Path.GetDirectoryName(Properties.Settings.Default.Path_GameExecutable), filePath); if (!File.Exists(vanillaFilePath)) { return("The selected mod contains an incompatible filesystem..."); } else { if (Path.GetExtension(file) == ".arc") { string incompatibleArc = "The selected mod contains incompatible archives..."; switch (system) { case "Xbox 360": if (!File.ReadAllText(file).Contains("xenon") && !File.ReadAllText(file).Contains("win32")) { return(incompatibleArc); } break; case "PlayStation 3": if (!File.ReadAllText(file).Contains("ps3") && !File.ReadAllText(file).Contains("win32")) { return(incompatibleArc); } break; case "All Systems": break; default: return(incompatibleArc); } } } } return("The selected mod should work properly with your configuration."); } else { return("The selected mod doesn't have a configuration file."); } } return(string.Empty); }