/// <summary>Gets the SMAPI update version.</summary> /// <returns>The SMAPI update version.</returns> public ISemanticVersion GetSMAPIUpdateVersion() { string updateMarker = (string)typeof(Constants).GetProperty("UpdateMarker", BindingFlags.Static | BindingFlags.NonPublic).GetValue(typeof(Constants)); //If there's no update marker, SMAPI is up to date //(Or there was an error, but we'd need to intercept console output to determine that) if (!File.Exists(updateMarker)) { return(Constants.ApiVersion); } //If there is an update marker, there is a SMAPI update string rawUpdate = File.ReadAllText(updateMarker); return(SemanticVersion.TryParse(rawUpdate, out ISemanticVersion updateFound) ? updateFound : null); }