private void ExtractorApache24Async_DoWork(object sender, DoWorkEventArgs e) { try { if (Directory.Exists(exPath) && !Directory.Exists(exPath + @"\Apache24")) { if (File.Exists(apachex64Path) || File.Exists(apachex86Path)) { if (InternalCheckIsWow64() == true) { ExtractZipFile(apachex64Path, exPath); } else { ExtractZipFile(apachex86Path, exPath); } CopyFolder("Apache24"); } } } catch (Exception ex) { if (ExtractorApache24Async.IsBusy) { ExtractorApache24Async.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(); } }