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); Thread.Sleep(1500); Installing iti = new Installing(); this.stepPanel.Controls.RemoveAt(0); this.stepPanel.Controls.Add(iti); ca.Dispose(); this.inStatus = InstallStatue.ZJInstalling; backgroundWorker2.RunWorkerAsync(); }
private void install_Click(object sender, EventArgs e) { // UserControl uc; if (!custom) { InstallDir id = (InstallDir)this.stepPanel.Controls[0]; id.install.Click -= new EventHandler(install_Click); id.custom.Click -= new EventHandler(custom_Click); uc = id; } else { Options op = (Options)this.stepPanel.Controls[0]; op.install.Click -= new EventHandler(install_Click); uc = op; dir = op.dir.Text; Settings.createDesktopshortcut = op.desktop.Checked; Settings.createTaskbar = op.taskbar.Checked; Settings.createStartMenu = op.startMenu.Checked; string regist = "/reg"; string unregist = ""; if (op.flac.Checked) { regist += "flac|"; } else { unregist += "flac,"; } if (op.aac.Checked) { regist += "aac|"; } else { unregist += "aac,"; } if (op.ape.Checked) { regist += "ape|"; } else { unregist += "ape,"; } if (op.cue.Checked) { regist += "cue|"; } else { unregist += "cue,"; } if (op.m4a.Checked) { regist += "m4a|"; } else { unregist += "m4a,"; } if (op.mp3.Checked) { regist += "mp3|"; } else { unregist += "mp3,"; } if (op.ofr.Checked) { regist += "ofr|"; } else { unregist += "ofr,"; } if (op.ogg.Checked) { regist += "ogg|"; } else { unregist += "ogg,"; } if (op.tak.Checked) { regist += "tak|"; } else { unregist += "tak,"; } if (op.tta.Checked) { regist += "tta|"; } else { unregist += "tta,"; } if (op.wav.Checked) { regist += "wav|"; } else { unregist += "wav,"; } if (op.wv.Checked) { regist += "wv|"; } else { unregist += "wv,"; } Settings.fileAss = regist + unregist; } 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); uc.Dispose(); return; } m.ReleaseMutex(); Installing iti = new Installing(); this.stepPanel.Controls.RemoveAt(0); this.stepPanel.Controls.Add(iti); uc.Dispose(); this.inStatus = InstallStatue.ZJInstalling; backgroundWorker2.RunWorkerAsync(); }
private void install_Click(object sender, EventArgs e) { // UserControl uc; if (!custom) { InstallDir id = (InstallDir)this.stepPanel.Controls[0]; id.install.Click -= new EventHandler(install_Click); id.custom.Click -= new EventHandler(custom_Click); uc = id; } else { Options op = (Options)this.stepPanel.Controls[0]; op.install.Click -= new EventHandler(install_Click); uc = op; dir = op.dir.Text; Settings.createDesktopshortcut = op.desktop.Checked; Settings.createTaskbar = op.taskbar.Checked; Settings.createStartMenu = op.startMenu.Checked; string regist = "/reg"; string unregist = ""; if (op.flac.Checked) regist += "flac|"; else unregist += "flac,"; if (op.aac.Checked) regist += "aac|"; else unregist += "aac,"; if (op.ape.Checked) regist += "ape|"; else unregist += "ape,"; if (op.cue.Checked) regist += "cue|"; else unregist += "cue,"; if (op.m4a.Checked) regist += "m4a|"; else unregist += "m4a,"; if (op.mp3.Checked) regist += "mp3|"; else unregist += "mp3,"; if (op.ofr.Checked) regist += "ofr|"; else unregist += "ofr,"; if (op.ogg.Checked) regist += "ogg|"; else unregist += "ogg,"; if (op.tak.Checked) regist += "tak|"; else unregist += "tak,"; if (op.tta.Checked) regist += "tta|"; else unregist += "tta,"; if (op.wav.Checked) regist += "wav|"; else unregist += "wav,"; if (op.wv.Checked) regist += "wv|"; else unregist += "wv,"; Settings.fileAss = regist + unregist; } 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); uc.Dispose(); return; } m.ReleaseMutex(); Installing iti = new Installing(); this.stepPanel.Controls.RemoveAt(0); this.stepPanel.Controls.Add(iti); uc.Dispose(); this.inStatus = InstallStatue.ZJInstalling; backgroundWorker2.RunWorkerAsync(); }