Infralution Support Forum Index Infralution Support
Support groups for Infralution products
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Installing an Upgrade over a license that is expired

 
Post new topic   Reply to topic    Infralution Support Forum Index -> Licensing Support
View previous topic :: View next topic  
Author Message
Dom



Joined: 19 May 2013
Posts: 34

PostPosted: Thu Nov 20, 2014 11:10 am    Post subject: Installing an Upgrade over a license that is expired Reply with quote

Hi

Simple question I hope.

I intend using the expiry date of a licence to validate the end users rights to continue to receive updates. To that end I have Disable Expired Licenses unchecked and allow the program to run after the expiry date (meaning of course that it must allow running with an expired license).

I can disable buttons within the program (based on the expiry date) to prevent users getting easy access to updates to which they aren't entitled. However if they were to get a newer version of the program beyond their expiry date and install that would the license still allow it to run?

Dom
Back to top
View user's profile Send private message
Dom



Joined: 19 May 2013
Posts: 34

PostPosted: Thu Nov 20, 2014 11:32 am    Post subject: Reply with quote

Hi

One more question related to this.

Assuming that the client can't install a new version over an expired license, but wants features in the new edition to which they aren't entitled they can always simply buy an extension to the license. Is it possible (using an authenticated licence here) to simply change the expiry date for their license or do you have to issue a completely new license.

If it transpires that it can be done, but only if using IPN then I guess that would make a good case for getting IPN.

Dom
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 4876

PostPosted: Thu Nov 20, 2014 9:25 pm    Post subject: Reply with quote

Quote:
I can disable buttons within the program (based on the expiry date) to prevent users getting easy access to updates to which they aren't entitled. However if they were to get a newer version of the program beyond their expiry date and install that would the license still allow it to run?


To prevent the newer version running you will need to do some work. The simplest way to do this would be to embed the release date in the application (as a date constant). You can then check that the release date is not after the expiry date. This does mean that you have to update that constant each time you release. An alternative might be to check the application file creation time - however this can fairly easily be changed by a user.

Quote:
Is it possible (using an authenticated licence here) to simply change the expiry date for their license or do you have to issue a completely new license.


You can change the expiry date for an existing license using the Authentication > Set Limits menu.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Dom



Joined: 19 May 2013
Posts: 34

PostPosted: Fri Nov 21, 2014 7:03 am    Post subject: Reply with quote

Many thanks

So if I read between the lines correctly setting a license to allow continued use after expiry (which is essentially what you would need to do if the expiry date is really being used just to check for support entitlement ) will not prevent the end user from installing a newer version over the old one and having it run without despite the fact that it should really revert to evaluation mode in those circumstances. Is that correct?

Now if it is, is it possible to have the licensing module store the date of first activation in a specific place in the registry to allow future installers to run a check against that at install time? Preventing the install seems to be a better option than allowing it to run successfully and then locking the program down following checks against a constant embedded therein.

In reality since I first purchased ILS you've made a lot of improvements to the product that have made the use of a licence that expires as a support entitlement device much easier. Having a way to have licences revert to evaluation mode would complete the process.

As I see it this could be done (using authenticated licences) by a cross referencing the first installed / expiry date with a constant (which I accept you would have to embed in the program (but that's easy enough to do with a build process) and then have the licence revert to evaluation mode if the two dates don't match. That way end users can try new features out ( in evaluation mode) purchase if they feel they need them or revert back to a fully functional and licensed previous version if they don't.

Theoretically all the information required to do that is already present in ILS, I just haven't figured out how to revert it back to evaluation mode.

Many thanks

Dom
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 4876

PostPosted: Fri Nov 21, 2014 11:22 pm    Post subject: Reply with quote

Create a method to check whether the license is valid for the current running build of the application:

Code:
/// <summary>
///  Is the license valid for this build of the application
/// </summary>
/// <param>The license to check</param>
/// <returns>True if the license is valid for this build</returns>
static bool IsValidForBuild(AuthenticatedLicense license)
{
    DateTime buildDate = DateTime.Parse("2014-11-30 00:00:00Z", System.Globalization.CultureInfo.InvariantCulture);
    if (license != null && license.ExpiryDate < buildDate)
    {
        MessageBox.Show("The installed license is not valid for this version of the application");
        return false;
    }
    return true;
}



Call this method after loading the license and also after the user installs the license.


Code:
// check if there is an installed license for the application
//
_license = _licenseProvider.GetLicense();

if (!IsValidForBuild(_license))
{
    _license = null;
}

// start a background thread to check with the authentication server that
// the license authentication is still valid
//
_licenseProvider.StartBackgroundAuthenticationCheck(_license);


// if there is no installed license then display the evaluation dialog until
// the user installs a license or selects Exit or Continue
//
while (!_licenseProvider.IsValid(_license))
{
    EvaluationMonitor evaluationMonitor = new RegistryEvaluationMonitor("MyEvaluationPassword");
    EvaluationDialog evaluationDialog = new EvaluationDialog();
    EvaluationDialogResult dialogResult = evaluationDialog.ShowDialog(evaluationMonitor);
    if (dialogResult == EvaluationDialogResult.Exit) return;    // exit the app
    if (dialogResult == EvaluationDialogResult.Continue) break; // exit the loop

    if (dialogResult == EvaluationDialogResult.InstallLicense)
    {
        AuthenticatedLicenseInstallForm licenseForm = new AuthenticatedLicenseInstallForm();
        _license = licenseForm.ShowDialog(_licenseProvider, _license);
        if (!IsValidForBuild(_license))
        {
            _license = null;
        }
    }
}


I haven't tested this but something like this should work.
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
CADbloke



Joined: 07 Jan 2016
Posts: 23
Location: Sydney

PostPosted: Sat Feb 10, 2018 8:36 am    Post subject: Reply with quote

for anyone who lands here, see also http://www.infralution.com/phpBB2/viewtopic.php?p=10837#10837
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Infralution Support Forum Index -> Licensing Support All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group