public LocalTopshelfTask(string exeName, string location, string instanceName, string username, string password) { string args = string.IsNullOrEmpty(instanceName) ? "" : " /instance:" + instanceName; if (username != null && password != null) { var user = username; var pass = password; if (username.ShouldPrompt()) user = _prompt.Prompt("Win Service '{0}' UserName".FormatWith(exeName)); if (password.ShouldPrompt()) pass = _prompt.Prompt("Win Service '{0}' For User '{1}' Password".FormatWith(exeName, username)); args += " /username:{0} /password:{1}".FormatWith(user, pass); } _task = new LocalCommandLineTask(new DotNetPath(), exeName) { Args = "install " + args, ExecutableIsLocatedAt = location, WorkingDirectory = location }; }
public LocalNServiceBusHostTask(string exeName, string location, string instanceName, string username, string password, string serviceName, string displayName, string description) { string args = string.IsNullOrEmpty(instanceName) ? "" : " /instance:\"{0}\"".FormatWith(instanceName); if (username != null && password != null) { var user = username; var pass = password; if (username.ShouldPrompt()) user = _prompt.Prompt("Win Service '{0}' UserName".FormatWith(exeName)); if (shouldPromptForPassword(username, password)) pass = _prompt.Prompt("Win Service '{0}' For User '{1}' Password".FormatWith(exeName, username)); args += " /userName:\"{0}\" /password:\"{1}\"".FormatWith(user, pass); } if (!string.IsNullOrEmpty(serviceName)) args += " /serviceName:\"{0}\"".FormatWith(serviceName); if (!string.IsNullOrEmpty(displayName)) args += " /displayName:\"{0}\"".FormatWith(displayName); if (!string.IsNullOrEmpty(description)) args += " /description:\"{0}\"".FormatWith(description); _task = new LocalCommandLineTask(new DotNetPath(), exeName) { Args = "/install " + args, ExecutableIsLocatedAt = location, WorkingDirectory = location }; }
public LocalNServiceBusInstallTask(string exeName, string location, string instanceName, string username, string password, string serviceName, string displayName, string description, bool startManually) { StringBuilder args = new StringBuilder("/install "); if (username != null && password != null) { var user = username; var pass = password; if (username.ShouldPrompt()) user = _prompt.Prompt("Win Service '{0}' UserName".FormatWith(exeName)); if (password.ShouldPrompt()) pass = _prompt.Prompt("Win Service '{0}' For User '{1}' Password".FormatWith(exeName, username)); args.Append(" /username:{0} /password:{1}".FormatWith(user, pass)); } if (!string.IsNullOrEmpty(instanceName)) args.AppendFormat(" /instance:{0}", instanceName); if (!string.IsNullOrEmpty(serviceName)) args.AppendFormat(" /serviceName:{0}", serviceName); if (!string.IsNullOrEmpty(displayName)) args.AppendFormat(" /displayName:{0}", displayName); if (!string.IsNullOrEmpty(description)) args.AppendFormat(" /description:{0}", description); if (startManually) args.Append(" /startManually"); _task = new LocalCommandLineTask(new DotNetPath(), exeName) { Args = args.ToString(), ExecutableIsLocatedAt = location, WorkingDirectory = location }; }
public LocalNServiceBusHostTask(string exeName, string location, NServiceBusHostExeArgs args) { _task = new LocalCommandLineTask(new DotNetPath(), exeName) { Args = args.ToString(), ExecutableIsLocatedAt = location, WorkingDirectory = location }; }
public LocalUninstallRavenDbAsServiceTask(string location) { _location = location; _task = new LocalCommandLineTask(new DotNetPath(), RavenConstants.RavenServerExecutable) { Args = RavenConstants.RavenAsServiceUninstallSwitch, ExecutableIsLocatedAt = location, WorkingDirectory = location }; }
public void VerifyCanRunWithExecutablePathSet() { var t = new LocalCommandLineTask(new DotNetPath(), "ping") { ExecutableIsLocatedAt = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Windows), "system32"), Args = "localhost" }; var result = t.Execute(); result.Results.Select(r => r.Status).ToList().ShouldContain(DeploymentItemStatus.Good); }
public LocalNServiceBusUninstallTask(string exeName, string location, string instanceName, string serviceName) { StringBuilder args = new StringBuilder("/uninstall "); if (!string.IsNullOrEmpty(instanceName)) args.AppendFormat(" /instance:{0}", instanceName); if (!string.IsNullOrEmpty(serviceName)) args.AppendFormat(" /serviceName:{0}", serviceName); _task = new LocalCommandLineTask(new DotNetPath(), exeName) { Args = args.ToString(), ExecutableIsLocatedAt = location, WorkingDirectory = location }; }
public LocalNServiceBusHostTask(string exeName, string location, string instanceName, string username, string password, string serviceName, string displayName, string description, string profiles) { string args = string.IsNullOrEmpty(instanceName) ? "" : " /instance:\"{0}\"".FormatWith(instanceName); if (username != null && password != null) { var user = username; var pass = password; if (username.ShouldPrompt()) { user = _prompt.Prompt("Win Service '{0}' UserName".FormatWith(exeName)); } if (shouldPromptForPassword(username, password)) { pass = _prompt.Prompt("Win Service '{0}' For User '{1}' Password".FormatWith(exeName, username)); } args += " /userName:\"{0}\" /password:\"{1}\"".FormatWith(user, pass); } if (!string.IsNullOrEmpty(serviceName)) { args += " /serviceName:\"{0}\"".FormatWith(serviceName); } if (!string.IsNullOrEmpty(displayName)) { args += " /displayName:\"{0}\"".FormatWith(displayName); } if (!string.IsNullOrEmpty(description)) { args += " /description:\"{0}\"".FormatWith(description); } if (!string.IsNullOrEmpty(profiles)) { args += " {0}".FormatWith(profiles); } _task = new LocalCommandLineTask(new DotNetPath(), exeName) { Args = "/install " + args, ExecutableIsLocatedAt = location, WorkingDirectory = location }; }
public LocalNServiceBusInstallTask(string exeName, string location, string instanceName, string username, string password, string serviceName, string displayName, string description, bool startManually) { StringBuilder args = new StringBuilder("/install "); if (username != null && password != null) { var user = username; var pass = password; if (username.ShouldPrompt()) { user = _prompt.Prompt("Win Service '{0}' UserName".FormatWith(exeName)); } if (password.ShouldPrompt()) { pass = _prompt.Prompt("Win Service '{0}' For User '{1}' Password".FormatWith(exeName, username)); } args.Append(" /username:{0} /password:{1}".FormatWith(user, pass)); } if (!string.IsNullOrEmpty(instanceName)) { args.AppendFormat(" /instance:{0}", instanceName); } if (!string.IsNullOrEmpty(serviceName)) { args.AppendFormat(" /serviceName:{0}", serviceName); } if (!string.IsNullOrEmpty(displayName)) { args.AppendFormat(" /displayName:{0}", displayName); } if (!string.IsNullOrEmpty(description)) { args.AppendFormat(" /description:{0}", description); } if (startManually) { args.Append(" /startManually"); } _task = new LocalCommandLineTask(new DotNetPath(), exeName) { Args = args.ToString(), ExecutableIsLocatedAt = location, WorkingDirectory = location }; }
public LocalNServiceBusHostUninstallTask(string exeName, string location, string instanceName, string serviceName) { string args = string.IsNullOrEmpty(instanceName) ? "" : " /instance:\"{0}\"".FormatWith(instanceName); if (!string.IsNullOrEmpty(serviceName)) args += " /serviceName:\"{0}\"".FormatWith(serviceName); _task = new LocalCommandLineTask(new DotNetPath(), exeName) { Args = "/uninstall " + args, ExecutableIsLocatedAt = location, WorkingDirectory = location }; }
public LocalNServiceBusUninstallTask(string exeName, string location, string instanceName, string serviceName) { StringBuilder args = new StringBuilder("/uninstall "); if (!string.IsNullOrEmpty(instanceName)) { args.AppendFormat(" /instance:{0}", instanceName); } if (!string.IsNullOrEmpty(serviceName)) { args.AppendFormat(" /serviceName:{0}", serviceName); } _task = new LocalCommandLineTask(new DotNetPath(), exeName) { Args = args.ToString(), ExecutableIsLocatedAt = location, WorkingDirectory = location }; }