/// <summary> /// Please pass the windows service information in /// </summary> /// <param name="windowsServiceName">Name of windows service</param> /// <param name="description">Description of windows service</param> /// <param name="windowsServicePath">Path to folder where windows service assembly stored</param> /// <param name="windowsServiceAssemblyName">Windows Service Assembly Name</param> /// <param name="wsAccountType">Windows Service Account Type</param> /// <param name="wsAccountUserName">Username of Windows Service when Account Type is USER</param> /// <param name="wsAccountPassword">Password of Windows Service when Account Type is USER</param> private WindowsServiceInstallInfo(string windowsServiceName, string description, string windowsServicePath, string windowsServiceAssemblyName, WindowsServiceAccountType wsAccountType, string wsAccountUserName, string wsAccountPassword) { _windowsServiceName = windowsServiceName.Trim(); _wsDescription = description.Trim(); _windowsServicePath = windowsServicePath; _windowsServiceAssemblyName = windowsServiceAssemblyName; _wsAccountType = wsAccountType; _wsAccountUserName = wsAccountUserName; _wsAccountPassword = wsAccountPassword; if (_wsAccountType == WindowsServiceAccountType.User && _wsAccountUserName == "") { throw new Exception("Username has to be provided if AccountType to start the windows service is USER"); } }
/// <summary> /// Please pass the windows service information in /// </summary> /// <param name="windowsServiceName">Name of windows service</param> /// <param name="description">Description of windows service</param> /// <param name="windowsServicePath">Path to folder where windows service assembly stored</param> /// <param name="windowsServiceAssemblyName">Windows Service Assembly Name</param> /// <param name="wsAccountType">Windows Service Account Type (not USER type)</param> public WindowsServiceInstallInfo(string windowsServiceName, string description, string windowsServicePath, string windowsServiceAssemblyName, WindowsServiceAccountType wsAccountType) : this(windowsServiceName, description, windowsServicePath, windowsServiceAssemblyName, wsAccountType, "", "") { }
/// <summary> /// Please pass the windows service information in /// </summary> /// <param name="windowsServicePath">Path to folder where windows service assembly stored</param> /// <param name="windowsServiceAssemblyName">Windows Service Assembly Name</param> /// <param name="wsAccountType">Windows Service Account Type (not USER type)</param> public WindowsServiceInstallInfo(string windowsServicePath, string windowsServiceAssemblyName, WindowsServiceAccountType wsAccountType) : this("", windowsServicePath, windowsServiceAssemblyName, wsAccountType) { }