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 

Evaluation Timer Doesn't Appear to Prevent App Launch

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



Joined: 01 Oct 2017
Posts: 16

PostPosted: Wed Mar 07, 2018 9:37 pm    Post subject: Evaluation Timer Doesn't Appear to Prevent App Launch Reply with quote

I'm testing this implementation in development (I'm still on a trial of ILS).

while (!LicData.IsValid)
{
EvaluationMonitor evaluationMonitor = new RegistryEvaluationMonitor("<snipped>");
EvaluationDialog evaluationDialog = new EvaluationDialog
{
TrialDays = 1,
ExtendedTrialDays = 1
};

EvaluationDialogResult dialogResult = evaluationDialog.ShowDialog(evaluationMonitor);
if (dialogResult == EvaluationDialogResult.Exit)
{
// exit the app
Current.Shutdown();
return false;
}
if (dialogResult == EvaluationDialogResult.Continue) break; // exit the loop

if (dialogResult == EvaluationDialogResult.InstallLicense)
{
LicData.InstallLicense();
}
}

The dialog pops up but still has the continue evaluation button and allows me to just click that and launch the app.

Is this a limitation of the trial? I was hoping to test licensing the app. Or have I got a logical error in the code above?
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Wed Mar 07, 2018 9:44 pm    Post subject: Reply with quote

See the following FAQ:

http://www.infralution.com/phpBB2/viewtopic.php?t=2553
_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
Jammer



Joined: 01 Oct 2017
Posts: 16

PostPosted: Thu Mar 08, 2018 7:55 am    Post subject: Reply with quote

Thanks for the reply. I had already read that which is why I'd set the values to the the same value in my code. The "Continue Evaluation" button is always enabled.

"If you don't want the continue button to be enabled at all once the TrialDays period has expired then you can just set ExtendedTrialDays to the same value as TrialDays."

As far as I can tell this is exactly what I've done but it's still enabling the button.
Back to top
View user's profile Send private message
Jammer



Joined: 01 Oct 2017
Posts: 16

PostPosted: Thu Mar 08, 2018 7:00 pm    Post subject: Reply with quote

I've just launched the app to check this and I've noticed that the property:

FirstUseDate

Is displaying what I would expect to see if I called DateTime.Now. Whereas the first time I ran this code with the current password value I'm using was the 02/02/2018 - 6 days ago.

I was expecting this component to read a date from a key but it always displays the result of DateTime.Now recorded for the FirstUseDate.

In fact whenever a run the app, FirstUseDate and LastUseDate are always identical values and the same value as my local system date time!

If I run the code like this (password is the same btw):

EvaluationMonitor evaluationMonitor = new RegistryEvaluationMonitor("<snip>", false, false)

I get a NullReferenceException with this stack trace:

at Infralution.Licensing.WPF.RegistryEvaluationMonitor.Decrypt(Byte[] data)
at Infralution.Licensing.WPF.RegistryEvaluationMonitor.DecryptDate(Byte[] data)
at Infralution.Licensing.WPF.RegistryEvaluationMonitor.ReadData(String productId, DateTime& firstUseDate, DateTime& lastUseDate, Int32& usageCount)
at Infralution.Licensing.WPF.RegistryEvaluationMonitor..ctor(String password, Boolean countUsageOncePerDay, Boolean suppressExceptions)

How can I successfully test this feature?
Back to top
View user's profile Send private message
Jammer



Joined: 01 Oct 2017
Posts: 16

PostPosted: Thu Mar 08, 2018 7:51 pm    Post subject: Reply with quote

Right, I think I know what might have happened.

I think I ran it first with a different password and I think it's now finding something to read but since the password changed it can no longer decrypt it. I've just checked my source control log and I don't have a record of the previous password to revert to.

Bugger.

How can I recover (yes, I know I'm stupid) my dev box from this state?
Back to top
View user's profile Send private message
Jammer



Joined: 01 Oct 2017
Posts: 16

PostPosted: Thu Mar 08, 2018 8:10 pm    Post subject: Reply with quote

Wow, sorry for the spam!!

I've just figured this all out. I've pulled the source from the RegistryEvaluation class so I could step through. I then pulled the keys and it's back up and running.

I'll put more effort into not doing stupid things.
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Fri Mar 09, 2018 12:31 am    Post subject: Reply with quote

Thanks for letting us know. Great that you've got it solved
_________________
Infralution Support
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