mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-24 09:44:47 +03:00
install service with Emby name
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using MediaBrowser.Model.Logging;
|
||||
using System.Linq;
|
||||
using System.ServiceProcess;
|
||||
|
||||
namespace MediaBrowser.ServerApplication
|
||||
@@ -8,8 +9,25 @@ namespace MediaBrowser.ServerApplication
|
||||
/// </summary>
|
||||
public class BackgroundService : ServiceBase
|
||||
{
|
||||
public static string Name = "MediaBrowser";
|
||||
public static string DisplayName = "Media Browser";
|
||||
public static string Name = "Emby";
|
||||
public static string DisplayName = "Emby Server";
|
||||
|
||||
public static string GetExistingServiceName()
|
||||
{
|
||||
try
|
||||
{
|
||||
if (ServiceController.GetServices().Any(s => s.ServiceName == "MediaBrowser"))
|
||||
{
|
||||
return "MediaBrowser";
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
return "MediaBrowser";
|
||||
}
|
||||
|
||||
return Name;
|
||||
}
|
||||
|
||||
private readonly ILogger _logger;
|
||||
|
||||
@@ -24,7 +42,7 @@ namespace MediaBrowser.ServerApplication
|
||||
|
||||
CanStop = true;
|
||||
|
||||
ServiceName = Name;
|
||||
ServiceName = GetExistingServiceName();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
Reference in New Issue
Block a user