private void cbTerms_CheckedChanged(object sender, EventArgs e) { if (!promptWarnings) { return; } if (cbTerms.Checked && !InstallProcess.isValidLocation(txtLocation.Text)) { MessageBox.Show("Set install location first."); cbTerms.Checked = false; return; } if (cbTerms.Checked) { var result = MessageBox.Show("By agreeing to the Terms and Conditions, you agree to the use of this Chess Client.\r\n" + "The Client uses a number of anti-cheating mechanisms, such as scanning active programs.\r\n" + "These mechanisms may infringe on your privacy.\r\n" + "If you have any concerns, close any private information before running the Client, or do not use it at all.\r\n" + "Any collected information is viewable only by the Chief Justice unless released in accordance to the Terms.", "Warning!", MessageBoxButtons.OKCancel, MessageBoxIcon.Warning); if (result != DialogResult.OK) { cbTerms.Checked = false; } } btnInstall.Enabled = cbTerms.Checked; }
private void btnBrowse_Click(object sender, EventArgs e) { lblFolderFeedback.Text = originalF; lblFolderFeedback.ForeColor = Color.FromKnownColor(KnownColor.ControlText); var browser = new FolderBrowserDialog(); browser.Description = "Select install folder"; browser.ShowNewFolderButton = true; //browser.SelectedPath = @"C:\Program Files (x86)\"; var r = browser.ShowDialog(); if (r == DialogResult.OK) { if (InstallProcess.isValidLocation(browser.SelectedPath)) { txtLocation.Text = browser.SelectedPath; } else { lblFolderFeedback.Text = "Folder path is not valid (must be empty)"; lblFolderFeedback.ForeColor = Color.Red; } } else { txtLocation.Text = ""; } cbTerms.Enabled = !string.IsNullOrWhiteSpace(txtLocation.Text); }
private void btnInstall_Click(object sender, EventArgs e) { if (btnInstall.Text.StartsWith("Un")) { btnInstall.Enabled = false; uninstall(); } else { if (!InstallProcess.isValidLocation(txtLocation.Text)) { return; } btnInstall.Enabled = false; INSTALL = new InstallProcess(txtLocation.Text, setUpdate, (y, z) => { this.Invoke(new Action(() => { lblBytes.Text = z; pbBar.Value = y; })); }); var latest = INSTALL.getLatestVersion(); INSTALL.install(new ClientVersion(latest)); } }