|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
using System;
|
|
|
|
|
using System.Diagnostics;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Security.Principal;
|
|
|
|
|
using NLog;
|
|
|
|
|
|
|
|
|
@ -26,6 +27,11 @@ namespace NzbDrone.Common.EnvironmentInfo
|
|
|
|
|
get { return Environment.UserInteractive; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static RuntimeInfo()
|
|
|
|
|
{
|
|
|
|
|
IsProduction = InternalIsProduction();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public bool IsAdmin
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
@ -45,9 +51,9 @@ namespace NzbDrone.Common.EnvironmentInfo
|
|
|
|
|
|
|
|
|
|
private static readonly string ProcessName = Process.GetCurrentProcess().ProcessName.ToLower();
|
|
|
|
|
|
|
|
|
|
public static bool IsProduction
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
public static bool IsProduction { get; private set; }
|
|
|
|
|
|
|
|
|
|
private static bool InternalIsProduction()
|
|
|
|
|
{
|
|
|
|
|
if (BuildInfo.IsDebug || Debugger.IsAttached) return false;
|
|
|
|
|
if (BuildInfo.Version.Revision > 10000) return false; //Official builds will never have such a high revision
|
|
|
|
@ -58,8 +64,9 @@ namespace NzbDrone.Common.EnvironmentInfo
|
|
|
|
|
if (lowerProcessName.Contains("jetbrain")) return false;
|
|
|
|
|
if (lowerProcessName.Contains("resharper")) return false;
|
|
|
|
|
|
|
|
|
|
if (Directory.GetCurrentDirectory().ToLower().Contains("teamcity")) return false;
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|