private void readmeButton_Click(object sender, EventArgs e) { if (list.SelectedItems.Count > 0) { AddOn addOn = (AddOn)list.SelectedItems[0].Tag; if (addOn.Readme != "" && File.Exists(Installer.GetReadmePath(addOn))) { TextViewer textViewer = new TextViewer(); textViewer.ShowReadme(addOn); } } }
private void okButton_Click(object sender, EventArgs e) { //AddOnSet testSet = new AddOnSet(); //AddOn addOn1 = new AddOn(AddOnType.AI, "X1", false); //addOn1.URL = "http://c-evo.org//files//v06_legal.exe"; //addOn1.Size = 690176; //testSet.Add(addOn1); //AddOn addOn2 = new AddOn(AddOnType.AI, "X2", false); //addOn2.URL = "http://c-evo.org//files//cevosetup.exe"; //addOn2.Size = 2957161; //testSet.Add(addOn2); //AddOn addOn3 = new AddOn(AddOnType.AI, "X3", false); //addOn3.URL = "http://c-evo.org//files//v0147.exe"; //addOn3.Size = 1953792; //testSet.Add(addOn3); //installer.Install(testSet); RegistryKey registry = Registry.CurrentUser.CreateSubKey(registryKeyPath); if (screenWindowRadio.Checked) { registry.SetValue("ScreenMode", 0); } else if (screenNormalRadio.Checked) { registry.SetValue("ScreenMode", 1); } else if (screenResolutionRadio.Checked) { registry.SetValue("ScreenMode", 2); if (resolutionBox.SelectedIndex >= 0) { registry.SetValue("ResolutionX", ((DisplayMode)resolutionBox.SelectedItem).mode.dmPelsWidth); registry.SetValue("ResolutionY", ((DisplayMode)resolutionBox.SelectedItem).mode.dmPelsHeight); registry.SetValue("ResolutionBPP", ((DisplayMode)resolutionBox.SelectedItem).mode.dmBitsPerPel); registry.SetValue("ResolutionFreq", ((DisplayMode)resolutionBox.SelectedItem).mode.dmDisplayFrequency); } } registry.Close(); installer.Uninstall(LanguageRemoveSet); installer.Uninstall(mapSelector.RemoveSet); installer.Uninstall(aiSelector.RemoveSet); installer.Install(LanguageAddSet); installer.Install(mapSelector.AddSet); installer.Install(aiSelector.AddSet); if (installer.InstallOrdered) { Visible = false; ProgressDialog progressDialog = new ProgressDialog(installer); progressDialog.Text = "Downloading..."; progressDialog.ShowDialog(); TextViewer textViewer = new TextViewer(); foreach (AddOn addOn in installer.Added) { if (addOn.Readme != "" && File.Exists(Installer.GetReadmePath(addOn))) { textViewer.ShowReadme(addOn); } } } else { installer.Go(); // remove only or nothing, expect this not to require progress indication } CloseAndRun(); }