private void btnImport_Click(object sender, EventArgs e) { this.Cursor = Cursors.WaitCursor; BTSTaskHelper btsTaskHelper = new BTSTaskHelper(this.BTServerInstallLoc); try { richTextBox1.Text = string.Empty; richTextBox1.Visible = true; string result = btsTaskHelper.ImportApp(txtAppName.Text, txtMSILocation.Text, Env); richTextBox1.AppendText(result); } catch (Exception exe) { MessageBox.Show(exe.Message); } this.Cursor = Cursors.Default; }
public override bool Execute(out string message) { bool result = false; string resultMessage; if (this.TargetEnvironment == null) { throw new ArgumentNullException("TargetEnvironment"); } result = BTSTaskHelper.ImportApp(this.ApplicationInfo.ApplicationName, this.PackageLocation, this.TargetEnvironment, out resultMessage); //_action.BizTalkEnvironmentName); if (result) { message = string.Format("Application successfully imported with '{0}' binding. \r\n{1}", this.TargetEnvironment, resultMessage); } else { message = "Application can not be imported. \r\n" + resultMessage; } return(result); }
private void btnfullDeploy_Click(object sender, EventArgs e) { this.Cursor = Cursors.WaitCursor; string result; richTextBox1.Text = string.Empty; richTextBox1.Visible = true; try { ExplorerOMHelper explorerHelper = new ExplorerOMHelper(this.DBServerName); BTSTaskHelper btsTaskHelper = new BTSTaskHelper(this.BTServerInstallLoc); DateTime tStart = DateTime.Now; writeLog("Checking for suspended Instances....."); bool IsInstance = explorerHelper.HasInProgressInstance(txtAppName.Text); if (IsInstance == true) { MessageBox.Show("Process aborted, Instance exists"); //stop process } else { writeLog("No suspended Instances.....Restarting associated hosts....."); bool HostsRestarted = explorerHelper.RestartHostInstance(txtAppName.Text); writeLog("Restarted associated hosts: " + HostsRestarted.ToString()); if (explorerHelper.HasDynamicSendPorts(txtAppName.Text)) { richTextBox1.SelectionFont = new Font(richTextBox1.Font, FontStyle.Bold); writeLog("..Dynamic send ports exists for the application. Manual intervention required to restart associated send handlers' hosts...."); } richTextBox1.SelectionFont = new Font(richTextBox1.Font, FontStyle.Regular); writeLog("Stopping application....."); explorerHelper.StopApp(txtAppName.Text); writeLog("Stopped application.....Deleting application....."); result = btsTaskHelper.DeleteApp(txtAppName.Text); writeLog(result); writeLog("Deleted application.....UnInstalling application....."); string UnInstallmessage = GenericHelper.UninstallApplication(txtAppName.Text, IdentifyingNumber, "1.0.0.0"); writeLog("Uninstalling application done:" + UnInstallmessage); if (!UnInstallmessage.Contains("error")) { writeLog("Installing application....."); string Installmessage = GenericHelper.InstallApplication(TempLocation, txtMSILocation.Text); writeLog("Installing application done:" + Installmessage); if (!Installmessage.Contains("error")) { writeLog("Importing application....."); result = btsTaskHelper.ImportApp(txtAppName.Text, txtMSILocation.Text, Env); writeLog(result); writeLog("Imported application.....Starting application....."); explorerHelper.StartApp(txtAppName.Text); writeLog("Started application....."); if (chkBxSSO.Checked == true) { if (!String.IsNullOrEmpty(txtSSOConfigLoc.Text)) { string exceptionMessage; bool boolresult = SSOHelper.ImportSSOconfig(SSOKey, txtSSOConfigLoc.Text, txtConfigAppName.Text, String.Format("BizTalkAdmin@{0}.com", SSOCompanyName), true, out exceptionMessage); if (boolresult) { writeLog("Successfully redeployed SSOconfig and refreshed cache."); } else { writeLog("Error is importing SSOconfig. Manual intervension required"); } } else { richTextBox1.SelectionFont = new Font(richTextBox1.Font, FontStyle.Bold); writeLog("No SSO Config file selected....Select file and Deploy SSO separately now.."); richTextBox1.SelectionFont = new Font(richTextBox1.Font, FontStyle.Regular); } } if (chkBxIIS.Checked == true) { string RestartIISMes = GenericHelper.RestartIIS(); if (!RestartIISMes.Contains("error")) { writeLog(RestartIISMes); } else { richTextBox1.SelectionFont = new Font(richTextBox1.Font, FontStyle.Bold); writeLog(RestartIISMes + "Manual Intervention required.."); richTextBox1.SelectionFont = new Font(richTextBox1.Font, FontStyle.Regular); } } DateTime tStop = DateTime.Now; TimeSpan tPass = tStop - tStart; this.Cursor = Cursors.Default; MessageBox.Show("Done in time: " + tPass.ToString()); } else { MessageBox.Show("Process aborted, Installing application failed"); //stop process } } else { MessageBox.Show("Process aborted, UnInstalling application failed"); //stop process } } } catch (Exception exe) { this.Cursor = Cursors.Default; MessageBox.Show(exe.Message); } }