public override bool Execute(out string message) { bool result = false; Validate(); string exceptionMessage; if (String.IsNullOrEmpty(this.SsoConfigLocation) || String.IsNullOrEmpty(this.SsoConfigApplicationName)) { message = String.IsNullOrEmpty(this.SsoConfigLocation) ? "SSO config file is not selected." : "SSO config application name is empty."; } else { result = SSOHelper.ImportSSOconfig(this.SsoKey, this.SsoConfigLocation, this.SsoConfigApplicationName, String.Format("BizTalkAdmin@{0}.com", this.SSOCompanyName), true, out exceptionMessage); message = result ? "SSO config successfully imported." : exceptionMessage; } return(result); }
private void redeploySSOToolStripMenuItem_Click(object sender, EventArgs e) { if (!string.IsNullOrEmpty(txtSSOConfigLoc.Text)) { string exceptionMessage; bool result = SSOHelper.ImportSSOconfig(SSOKey, txtSSOConfigLoc.Text, txtConfigAppName.Text, String.Format("BizTalkAdmin@{0}.com", SSOCompanyName), true, out exceptionMessage);; if (result) { MessageBox.Show("Successfully redeployed SSOconfig and refreshed cache."); } else { MessageBox.Show("Error is importing SSOconfig. Manual intervension required"); } } else { MessageBox.Show("Select valid SSO Config file"); } }
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); } }