subscription license code additions

This commit is contained in:
2022-08-17 03:03:48 +00:00
parent 7d2076d1c7
commit b9d33ff036
11 changed files with 91 additions and 25 deletions

View File

@@ -603,11 +603,13 @@ namespace AyaNova
//Initialize license unless it doesn't exist yet then wait and do it after schema update and fingerprint
//this is necessary to accomodate checking build date against subscription and preventing schema update if they upgrade but are not entitled to
//this is necessary to accomodate checking build date against subscription or perpetual / subscription vs build type and preventing schema update if they upgrade but are not entitled to
//so they don't fuck their database
//if there is a build date issue or a license issue it will fail with an exception, log to log file, log to console and not go beyond the license check preserving the db
//if there is a build date issue or a license type mismatch issue it will fail with an exception, log to log file, log to console and not go beyond the license check preserving the db
//Note: case 4160 is to build an external license fetcher utility to allow a user to upgrade without uninstalling the newer version by purchasing a new sub and installing the key out of AyaNova
//If they don't want to purchase then they must downgrade
//If they don't want to purchase then they must downgrade HOWEVER they can do the case 4170 thing with the flag AYANOVA_REMOVE_LICENSE_FROM_DB
//NOTE: AYANOVA_REMOVE_LICENSE_FROM_DB boot flag can be used to work around this issue
bool licenseChecked = false;
try
{
@@ -625,11 +627,11 @@ namespace AyaNova
}
catch (Exception ex)
{
//Only re-throw if it's a 1020 error with the text VERSION-TOO-NEW included, any other error allow it to keep doing it's thing below before the second license init
//Only re-throw if it's a 1020 error with the text defined in LICENSE_MISMATCH_TO_BUILD_ERROR included, any other error allow it to keep doing it's thing below before the second license init
//our exception is buried inside multiple inner exceptions but it's the innermost so drill down into it
while (ex.InnerException != null)
ex = ex.InnerException;
if (ex.Message.Contains("1020") && ex.Message.Contains("VERSION-TOO-NEW "))
if (ex.Message.Contains("1020") && ex.Message.Contains(AyaNova.Core.License.LICENSE_MISMATCH_TO_BUILD_ERROR))
{
throw new Exception("AyaNova did not start to protect the integrity of your data, see the console and / or error log for details");
}