Updated production detection to use path as well as version number.

This commit is contained in:
kay.one 2012-02-17 16:27:32 -08:00
parent 2064700eb1
commit ac639120e3
1 changed files with 11 additions and 3 deletions

View File

@ -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;
}