private void DoInstall(string OutputFile) { List <string> InstallFileList = new List <string>(); InstallFileList.Add(OutputFile); ProgressWindow.Show("Installing Mod", String.Format("Installing {0}, please wait...", cm.textModName.Text), new Action((MethodInvoker) delegate { InstallManager.InstallMods(InstallFileList); }), log); }
private void buttonContinue_Click(object sender, EventArgs e) // the listed mods are checked against installed mods/gamefiles for conflicts. { List <string> modFiles = new List <string>(); foreach (PreinstallEntry entry in Mods) { modFiles.Add(entry.filename); } log.ClearPage(); SetVisiblePage(log); ProgressWindow.Show("Checking Validity", "Checking mod validity...", new Action((MethodInvoker) delegate { PreinstallManager.FilterModValidity(modFiles); }), log); if (modFiles.Count == 0) { refreshInstallList(); return; } //no valid mods. no mods will be installed formLocation = Location; // to center the conflict window formSize = Size; ProgressWindow.Show("Checking Conflicts", "Checking for conflicts with installed mods...", new Action((MethodInvoker) delegate { PreinstallManager.FilterModConflicts(modFiles); }), log); if (modFiles.Count == 0) { refreshInstallList(); return; } //remaining mods had conflicts, user chose to install none. string modsToInstall = ""; for (int i = 0; i < modFiles.Count; i++) { modsToInstall += "\n" + Tools.ReadMetaData(modFiles[i]).Name; } DialogResult confirmInstall = MessageBox.Show(String.Format("The following mods will be installed:\n" + modsToInstall), "SnakeBite", MessageBoxButtons.OKCancel); if (confirmInstall == DialogResult.OK) { ProgressWindow.Show("Installing Mod(s)", "Installing, please wait...", new Action((MethodInvoker) delegate { InstallManager.InstallMods(modFiles); }), log); Close(); // the form closes upon installation. If the install is cancelled, the form remains open. } else { refreshInstallList(); } }