1
0
Fork 0
mirror of https://github.com/lidarr/Lidarr synced 2024-12-25 09:12:17 +00:00

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

View file

@ -13,15 +13,23 @@ public class EnviromentProvider
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;
}