mirror of
https://github.com/Sonarr/Sonarr
synced 2024-12-26 09:47:39 +00:00
Updated production detection to use path as well as version number.
This commit is contained in:
parent
2064700eb1
commit
ac639120e3
1 changed files with 11 additions and 3 deletions
|
@ -13,15 +13,23 @@ namespace NzbDrone.Common
|
||||||
|
|
||||||
private static readonly string processName = Process.GetCurrentProcess().ProcessName.ToLower();
|
private static readonly string processName = Process.GetCurrentProcess().ProcessName.ToLower();
|
||||||
|
|
||||||
|
private static readonly EnviromentProvider instance = new EnviromentProvider();
|
||||||
|
|
||||||
public static bool IsProduction
|
public static bool IsProduction
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (IsDebug || Debugger.IsAttached) return false;
|
if (IsDebug || Debugger.IsAttached) return false;
|
||||||
|
if (instance.Version.Revision > 10000) return false; //Official builds will never have such a high revision
|
||||||
|
|
||||||
|
var lowerProcessName = processName.ToLower();
|
||||||
|
if (lowerProcessName.Contains("vshost")) return false;
|
||||||
|
if (lowerProcessName.Contains("nunit")) return false;
|
||||||
|
if (lowerProcessName.Contains("jetbrain")) return false;
|
||||||
|
if (lowerProcessName.Contains("resharper")) return false;
|
||||||
|
|
||||||
|
if (instance.ApplicationPath.ToLower().Contains("_rawpackage")) return false;
|
||||||
|
|
||||||
if (processName.Contains("nunit")) return false;
|
|
||||||
if (processName.Contains("jetbrain")) return false;
|
|
||||||
if (processName.Contains("resharper")) return false;
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue