From eea46271c4d2bb8609e51d08b5aea2bdad622125 Mon Sep 17 00:00:00 2001 From: RKrom Date: Tue, 11 Nov 2014 14:57:03 +0100 Subject: [PATCH] This change makes the code automatically detect what type of build it is, UNSTABLE, RC or Release Candidate. The AssemblyInformationalVersion should be set from AppVeyor, and this code reads it back. --- GreenshotPlugin/Core/CoreConfiguration.cs | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/GreenshotPlugin/Core/CoreConfiguration.cs b/GreenshotPlugin/Core/CoreConfiguration.cs index 8a11d5837..535c581f3 100644 --- a/GreenshotPlugin/Core/CoreConfiguration.cs +++ b/GreenshotPlugin/Core/CoreConfiguration.cs @@ -291,8 +291,23 @@ namespace GreenshotPlugin.Core { } } - // Specifies what THIS build is - public BuildStates BuildState = BuildStates.RELEASE_CANDIDATE; + /// + /// Specifies what THIS build is + /// + public BuildStates BuildState { + get { + string informationalVersion = Application.ProductVersion; + if (informationalVersion != null) { + if (informationalVersion.ToLowerInvariant().Contains("-rc")) { + return BuildStates.RELEASE_CANDIDATE; + } + if (informationalVersion.ToLowerInvariant().Contains("-unstable")) { + return BuildStates.UNSTABLE; + } + } + return BuildStates.RELEASE; + } + } public bool UseLargeIcons { get {