release 8.0.2 case 4164 build date vs maint expiration date for expired trial keys preventing upgrade

This commit is contained in:
2022-08-12 20:19:07 +00:00
parent afdbc0df83
commit 7ae610a5d9
8 changed files with 205 additions and 39 deletions

View File

@@ -4,8 +4,8 @@
</PropertyGroup>
<PropertyGroup>
<GenerateFullPaths>true</GenerateFullPaths>
<Version>8.0.1</Version>
<FileVersion>8.0.1.0</FileVersion>
<Version>8.0.2</Version>
<FileVersion>8.0.2.0</FileVersion>
<ApplicationIcon>ayanova.ico</ApplicationIcon>
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml</DocumentationFile>
<noWarn>1591</noWarn>

View File

@@ -5,7 +5,7 @@ namespace AyaNova.Util
/// </summary>
internal static class AyaNovaVersion
{
public const string VersionString = "8.0.1";
public const string VersionString = "8.0.2";
public const string FullNameAndVersion = "AyaNova server " + VersionString;
public const string CurrentApiVersion="v8";
}//eoc

View File

@@ -929,8 +929,8 @@ EQIDAQAB
//Check if attempting to use a build of AyaNova that is newer than maintenance subscription expiry
if (MExBB(Util.FileUtil.GetLinkerTimestampUtc(System.Reflection.Assembly.GetExecutingAssembly()), key))
{
Console.WriteLine("E1020 - Not licensed for this version of AyaNova. Fix: downgrade back to previous version in use or contact technical support for options.");
Console.WriteLine("E1020 - Not licensed for this version of AyaNova. Fix: downgrade back to previous version in use or contact technical support for options.");
//NOTE: VERSION-TOO-NEW bit below is checked for in startup.cs DO NOT remove this without fixing the side effects
throw new ApplicationException("E1020 VERSION-TOO-NEW - Not licensed for this version of AyaNova. Fix: downgrade back to previous version in use or contact technical support for options.");
}
@@ -953,7 +953,21 @@ EQIDAQAB
#region Validate Build date against maintenance date in license
//MaintenanceExpirationBeforeBuild?
internal static bool MExBB(DateTime dtB, AyaNovaLicenseKey k) => k.MaintenanceExpiration < dtB;
internal static bool MExBB(DateTime dtB, AyaNovaLicenseKey k)
{
//Is maintenance expiration date an earlier date than the current build date?
//return true if a problem or false if ok
//Do not worry about evaluation / trial licenses
//users can upgrade them any time
if (k.TrialLicense) return false;
//Do not worry about rental SAAS licenses, only we can upgrade them
if(k.RentalLicense) return false;
//Ok, it's a perpetual license and not a trial so check away
return k.MaintenanceExpiration < dtB;
}
#endregion