Skip to content

Commit

Permalink
Added option api to change service description and display name via c…
Browse files Browse the repository at this point in the history
…onfigurator
  • Loading branch information
PeterKottas committed Dec 29, 2016
1 parent 5be51ba commit 701df80
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
21 changes: 20 additions & 1 deletion Source/PeterKottas.DotNetCore.WindowsService/HostConfigurator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,26 @@ public HostConfigurator(HostConfiguration<SERVICE> innerConfig)

public void SetName(string serviceName)
{
innerConfig.Name = serviceName;
if (string.IsNullOrEmpty(innerConfig.Name))
{
innerConfig.Name = serviceName;
}
}

public void SetDisplayName(string displayName)
{
if (string.IsNullOrEmpty(innerConfig.DisplayName))
{
innerConfig.DisplayName = displayName;
}
}

public void SetDescription(string description)
{
if (string.IsNullOrEmpty(innerConfig.Description))
{
innerConfig.Description = description;
}
}

public string GetDefaultName()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<metadata>
<id>PeterKottas.DotNetCore.WindowsService</id>
<title>PeterKottas.DotNetCore.WindowsService</title>
<version>1.0.2</version>
<version>1.0.3</version>
<authors>Peter Kottas</authors>
<description>Easiest to use library that allows one to host .net core as windows services there is.</description>
<summary>.NET Core Windows service</summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public static int Run(Action<HostConfigurator<SERVICE>> runAction)
config.AddParameter(new CmdArgParam()
{
Key = "action",
Description = "Installs the service. It's run like console application othrwise",
Description = "Installs the service. It's run like console application otherwise",
Value = val =>
{
switch (val)
Expand Down

0 comments on commit 701df80

Please sign in to comment.