mirror of
https://github.com/Ombi-app/Ombi.git
synced 2025-08-20 13:23:20 -07:00
Bunch of updater files
This commit is contained in:
parent
0da49440e2
commit
3d6264095e
16 changed files with 1063 additions and 4 deletions
39
Ombi.Updater/DetectApplicationType.cs
Normal file
39
Ombi.Updater/DetectApplicationType.cs
Normal file
|
@ -0,0 +1,39 @@
|
|||
using Ombi.Common;
|
||||
using Ombi.Common.EnvironmentInfo;
|
||||
using Ombi.Common.Processes;
|
||||
|
||||
namespace Ombi.Updater
|
||||
{
|
||||
public class DetectApplicationType
|
||||
{
|
||||
public DetectApplicationType()
|
||||
{
|
||||
_processProvider = new ProcessProvider();
|
||||
_serviceProvider = new ServiceProvider(_processProvider);
|
||||
}
|
||||
|
||||
private readonly IServiceProvider _serviceProvider;
|
||||
private readonly IProcessProvider _processProvider;
|
||||
public AppType GetAppType()
|
||||
{
|
||||
if (OsInfo.IsNotWindows)
|
||||
{
|
||||
// Technically it is the console, but it has been renamed for mono (Linux/OS X)
|
||||
return AppType.Normal;
|
||||
}
|
||||
|
||||
if (_serviceProvider.ServiceExist(ServiceProvider.OmbiServiceName)
|
||||
)
|
||||
{
|
||||
return AppType.Service;
|
||||
}
|
||||
|
||||
if (_processProvider.Exists(ProcessProvider.OmbiProcessName))
|
||||
{
|
||||
return AppType.Console;
|
||||
}
|
||||
|
||||
return AppType.Normal;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue