private void uninstall_Click(object sender, EventArgs e) { Readdy rd = (Readdy)this.stepPanel.Controls[0]; rd.uninstall.Click -= new EventHandler(uninstall_Click);; rd.cancel.Click -= new EventHandler(cancel_Click); bool canCreateNew; Mutex m = new Mutex(true, Settings.mutexName, out canCreateNew); if (!canCreateNew) { CloseApp ca = new CloseApp(); ca.richTextBox1.AppendText("ZLPlayer.exe"); ca.continueBtn.Click += new EventHandler(continueBtn_Click); this.stepPanel.Controls.RemoveAt(0); this.stepPanel.Controls.Add(ca); rd.Dispose(); return; } m.ReleaseMutex(); UnInstalling ui = new UnInstalling(); this.stepPanel.Controls.RemoveAt(0); this.stepPanel.Controls.Add(ui); rd.Dispose(); uninstalling = true; backgroundWorker1.RunWorkerAsync(); }
private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { UnInstalling ui = (UnInstalling)this.stepPanel.Controls[0]; ui.status.Text = "deleting program folder..."; ui.progressBar1.Value = 100; Thread.Sleep(300); uninstalling = false; Finish fi = new Finish(); fi.finishBtn.Click += new EventHandler(finishBtn_Click); this.stepPanel.Controls.RemoveAt(0); this.stepPanel.Controls.Add(fi); ui.Dispose(); }
private void backgroundWorker1_ProgressChanged(object sender, ProgressChangedEventArgs e) { UnInstalling ui = (UnInstalling)this.stepPanel.Controls[0]; if (0 == e.ProgressPercentage) { ui.status.Text = "Unregisting file association..."; } else if (25 == e.ProgressPercentage) { ui.status.Text = "Deleting Registry..."; } else if (75 == e.ProgressPercentage) { ui.status.Text = "Deleting shortcuts.."; } ui.progressBar1.Value = e.ProgressPercentage; }
private void continueBtn_Click(object sender, EventArgs e) { CloseApp ca = (CloseApp)this.stepPanel.Controls[0]; ca.continueBtn.Enabled = false; ca.richTextBox1.Text = "Closing Program..."; semaphore = new Semaphore(0, 1); Thread thread = new Thread(ThreadFun); thread.Start(); semaphore.WaitOne(); semaphore.Close(); ca.continueBtn.Click -= new EventHandler(continueBtn_Click); UnInstalling ui = new UnInstalling(); this.stepPanel.Controls.RemoveAt(0); this.stepPanel.Controls.Add(ui); ca.Dispose(); uninstalling = true; backgroundWorker1.RunWorkerAsync(); }
private void uninstall_Click(object sender, EventArgs e) { Readdy rd = (Readdy)this.stepPanel.Controls[0]; rd.uninstall.Click -= new EventHandler(uninstall_Click); ; rd.cancel.Click -= new EventHandler(cancel_Click); bool canCreateNew; Mutex m = new Mutex(true, Settings.mutexName, out canCreateNew); if (!canCreateNew) { CloseApp ca = new CloseApp(); ca.richTextBox1.AppendText("ZLPlayer.exe"); ca.continueBtn.Click += new EventHandler(continueBtn_Click); this.stepPanel.Controls.RemoveAt(0); this.stepPanel.Controls.Add(ca); rd.Dispose(); return; } m.ReleaseMutex(); UnInstalling ui = new UnInstalling(); this.stepPanel.Controls.RemoveAt(0); this.stepPanel.Controls.Add(ui); rd.Dispose(); uninstalling = true; backgroundWorker1.RunWorkerAsync(); }