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 

UninstallLicense

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



Joined: 11 Jan 2010
Posts: 3

PostPosted: Mon Jan 11, 2010 3:25 am    Post subject: UninstallLicense Reply with quote

Hi,

Evaluating the product, it's first use will be for a class library to ensure that it is only referenced by licensed developers.

I've added a Licensing class and applied LicenseProvider attribute, and the nag screen comes up every time I compile the sample console app - great.

I then entered a product key and it goes away - great.

Now I want to test it again with no valid license, and I'm using following code in a method called by the test app, and the license is not uninstalled.

(this code is in the class library as a test - I have no idea where the generated license data is)
EncryptedLicenseProvider.SetParameters(LICENSE_PARAMETERS);
EncryptedLicenseProvider provider = new EncryptedLicenseProvider();
provider.UninstallLicense(typeof(PlotFile.PlotFactory));
EvaluationMonitor evaluationMonitor = new RegistryEvaluationMonitor("TEST");
if (!LicenseManager.IsLicensed(typeof(PlotFile.PlotFactory)))
throw new Exception("UXLibrary not licensed.");

Please advise what I need to do/am doing wrong.
Back to top
View user's profile Send private message
TimS



Joined: 11 Jan 2010
Posts: 3

PostPosted: Mon Jan 11, 2010 10:09 pm    Post subject: Re: UninstallLicense Reply with quote

Ok, finding and removing the .LIC files was easy, and I've verified that that the license check when referencing the class library .DLL on another machine without a license works as expected.

But UninstallLicense still doesn't work! (in this case the .lic file is in the bin directory of the library, which I expect is default location).
Back to top
View user's profile Send private message
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Tue Jan 12, 2010 7:48 am    Post subject: Reply with quote

UninstallLicense just deletes the License file - so next time you use the component there will be no license.

The location of the license file is (by default) determined from the assembly path. The problem I think you are having is that the assembly used at design time and runtime are actually different. At design time the assembly is the one in the library bin directory. At runtime the assembly used is the one that is copied by default into the application bin directory. So when your application is running that is where it will look to delete the license file.

The solution is to derive your license provider class and override the GetLicenseDirectory method to return a fixed directory (typically under the CommonApplicationData directory). This is actually a good idea anyway to avoid issues when your component is placed in the GAC - as described in the following thread:

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



Joined: 11 Jan 2010
Posts: 3

PostPosted: Wed Jan 13, 2010 7:32 pm    Post subject: Reply with quote

Cheers, all under control now.
Back to top
View user's profile Send private message
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