public void ImportFromArgumentString(Command command) { string[] components = command["-components"].Split(','); foreach (string component in components) { IComponentInstaller installer = null; switch (component) { case "Client": { installer = new Components.ClientInstaller(); } break; case "MapEditor": { installer = new Components.MapEditorInstaller(); } break; } if (installer != null) { installer.ParseConfigString(command); this.components.Add(installer); } } }
public void RunUninstall() { string component = null; int index = Globals.CommandLine.FindCommandArg("/Uninstall"); if (index != -1) { component = Globals.CommandLine[index + 1]; } // We are, so let's start uninstalling if (System.IO.Path.GetTempPath().StartsWith(Application.StartupPath)) { try { //frmUninstallSetup setup = new frmUninstallSetup(param); //setup.Show(); if (!string.IsNullOrEmpty(component)) { switch (component) { case "Client": { if (MessageBox.Show("Are you sure you wish to uninstall Pokémon Mystery Universe?", "Uninstall", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes) { Components.ClientInstaller client = new Components.ClientInstaller(); client.Uninstall(); MessageBox.Show("Uninstallation complete!"); System.Environment.Exit(0); } } break; case "MapEditor": { if (MessageBox.Show("Are you sure you wish to uninstall the PMU Map Editor?", "Uninstall", MessageBoxButtons.YesNo) == System.Windows.Forms.DialogResult.Yes) { Components.MapEditorInstaller mapEditor = new Components.MapEditorInstaller(); mapEditor.Uninstall(); MessageBox.Show("Uninstallation complete!"); System.Environment.Exit(0); } } break; } } } catch (Exception ex) { System.Windows.Forms.MessageBox.Show(ex.ToString()); } } else { System.IO.File.Copy(Application.ExecutablePath, System.IO.Path.GetTempPath() + "Uninstaller.exe", true); System.Diagnostics.Process.Start(System.IO.Path.GetTempPath() + "Uninstaller.exe", "/Uninstall " + component); System.Environment.Exit(0); } }