diff --git a/src/GitVersionCore/BuildServers/ContinuaCi.cs b/src/GitVersionCore/BuildServers/ContinuaCi.cs index c202b56271..1cfff16e44 100644 --- a/src/GitVersionCore/BuildServers/ContinuaCi.cs +++ b/src/GitVersionCore/BuildServers/ContinuaCi.cs @@ -1,24 +1,16 @@ namespace GitVersion { - using Microsoft.Win32; + using System; public class ContinuaCi : BuildServerBase { - public override bool CanApplyToCurrentContext() - { - const string KeyName = @"Software\VSoft Technologies\Continua CI Agent"; - if (RegistryKeyExists(KeyName, RegistryView.Registry32)) - { - return true; - } + public const string EnvironmentVariableName = "ContinuaCI.Version"; - if (RegistryKeyExists(KeyName, RegistryView.Registry64)) - { - return true; - } + public override bool CanApplyToCurrentContext() + { + return !string.IsNullOrEmpty(Environment.GetEnvironmentVariable(EnvironmentVariableName)); - return false; } public override string[] GenerateSetParameterMessage(string name, string value) @@ -32,14 +24,6 @@ public override string[] GenerateSetParameterMessage(string name, string value) public override string GenerateSetVersionMessage(VersionVariables variables) { return string.Format("@@continua[setBuildVersion value='{0}']", variables.FullSemVer); - } - - static bool RegistryKeyExists(string keyName, RegistryView registryView) - { - var localKey = RegistryKey.OpenBaseKey(RegistryHive.LocalMachine, registryView); - localKey = localKey.OpenSubKey(keyName); - - return localKey != null; - } + } } }