2013-06-28 00:04:52 +00:00
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
namespace NzbDrone.Common.EnvironmentInfo
|
|
|
|
|
{
|
|
|
|
|
public static class OsInfo
|
|
|
|
|
{
|
|
|
|
|
|
2013-08-04 17:26:37 +00:00
|
|
|
|
static OsInfo()
|
2013-06-28 00:04:52 +00:00
|
|
|
|
{
|
2013-08-04 17:26:37 +00:00
|
|
|
|
Version = Environment.OSVersion.Version;
|
|
|
|
|
IsMono = Type.GetType("Mono.Runtime") != null;
|
2013-06-28 00:04:52 +00:00
|
|
|
|
|
2013-08-04 17:26:37 +00:00
|
|
|
|
int platform = (int)Environment.OSVersion.Platform;
|
|
|
|
|
IsLinux = (platform == 4) || (platform == 6) || (platform == 128);
|
|
|
|
|
|
2013-06-28 00:04:52 +00:00
|
|
|
|
}
|
|
|
|
|
|
2013-08-04 17:26:37 +00:00
|
|
|
|
public static Version Version { get; private set; }
|
|
|
|
|
|
|
|
|
|
public static bool IsMono { get; private set; }
|
|
|
|
|
|
|
|
|
|
public static bool IsLinux { get; private set; }
|
2013-06-28 00:04:52 +00:00
|
|
|
|
|
2013-08-04 17:26:37 +00:00
|
|
|
|
public static bool IsWindows
|
2013-06-28 00:04:52 +00:00
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
2013-08-04 17:26:37 +00:00
|
|
|
|
return !IsLinux;
|
2013-06-28 00:04:52 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|