From ac639120e371639583f77532aaef5f22db0fd569 Mon Sep 17 00:00:00 2001 From: "kay.one" Date: Fri, 17 Feb 2012 16:27:32 -0800 Subject: [PATCH] Updated production detection to use path as well as version number. --- NzbDrone.Common/EnviromentProvider.cs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/NzbDrone.Common/EnviromentProvider.cs b/NzbDrone.Common/EnviromentProvider.cs index 92fcab788..d18383e51 100644 --- a/NzbDrone.Common/EnviromentProvider.cs +++ b/NzbDrone.Common/EnviromentProvider.cs @@ -13,15 +13,23 @@ namespace NzbDrone.Common private static readonly string processName = Process.GetCurrentProcess().ProcessName.ToLower(); + private static readonly EnviromentProvider instance = new EnviromentProvider(); + public static bool IsProduction { get { 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; }