private void ExtractorPHJAsync_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { try { if (installSucc == true) { instProgress.Value = instProgress.Maximum; dnPerc.Text = "100%"; startInstall.Text = "Start Service"; startInstall.BackColor = Color.DodgerBlue; startInstall.Enabled = true; allowClose = true; instDetails.Text = "Installation Complete"; tableLayoutPanel1.Cursor = System.Windows.Forms.Cursors.Default; /*DialogResult bracketsInstall = MessageBox.Show("Do you want to install Brackets IDE?", "Install Brackets?", MessageBoxButtons.YesNo); * if (bracketsInstall == DialogResult.Yes) * { * Process.Start("http://brackets.io/"); * }*/ } } catch (Exception ex) { if (ExtractorPHJAsync.IsBusy) { ExtractorPHJAsync.CancelAsync(); } InstallationFailed(ex); } }
private void ExtractorPHJAsync_DoWork(object sender, DoWorkEventArgs e) { try { if (File.Exists(phjPath)) { if (!Directory.Exists(exPath + @"\phj-master")) { ExtractZipFile(phjPath, exPath); } CopyPHJContent("phj-master"); installSucc = true; } else { throw new Exception(); } } catch (Exception ex) { if (ExtractorPHJAsync.IsBusy) { ExtractorPHJAsync.CancelAsync(); } InstallationFailed(ex); } }
private void phjInstall_FormClosing(object sender, FormClosingEventArgs e) { try { if (allowClose == false) { e.Cancel = true; DialogResult quitYesno = MessageBox.Show("Installation in progress. \n\n Quit installation?", "Warning!", MessageBoxButtons.YesNo); if (quitYesno == DialogResult.Yes) { e.Cancel = false; allowClose = true; if (InstallApache24Async.IsBusy) { InstallApache24Async.CancelAsync(); } if (InstallPHJAsync.IsBusy) { InstallPHJAsync.CancelAsync(); } if (ExtractorApache24Async.IsBusy) { ExtractorApache24Async.CancelAsync(); } if (ExtractorPHJAsync.IsBusy) { ExtractorPHJAsync.CancelAsync(); } this.Close(); } else if (quitYesno == DialogResult.No) { e.Cancel = true; } } else { e.Cancel = false; } } catch (Exception ex) { /*e.Cancel = true; * MessageBox.Show(ex.Message);*/ } }
private void ExtractorApache24Async_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { if (ExtractorApache24Async.IsBusy) { ExtractorApache24Async.CancelAsync(); } if (!File.Exists(phjPath) && IsDirectoryEmpty(rootPath + @"\Apache24\htdocs")) { InstallPHJAsync.RunWorkerAsync(); } else if (File.Exists(phjPath) && IsDirectoryEmpty(rootPath + @"\Apache24\htdocs")) { ExtractorPHJAsync.RunWorkerAsync(); } }
private void InstallPHJAsync_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e) { try { if (!Directory.Exists(exPath)) { Directory.CreateDirectory(exPath); } if (Directory.Exists(exPath) && !Directory.Exists(exPath + @"\phj-master") && File.Exists(phjPath)) { ExtractorPHJAsync.RunWorkerAsync(); } else { //throw new Exception(); } } catch (Exception ex) { //InstallationFailed(ex); } }