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 

Help doing first program

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



Joined: 04 Mar 2007
Posts: 21

PostPosted: Mon Oct 13, 2008 8:49 pm    Post subject: Help doing first program Reply with quote

Hi, I am trying to get my first licensing program going finally after some dealys I have been going through the help and sample project and translating it into my project I think I am doing it right so far but it doesn't quite do what I want.

I want my program to start, splash screen to display which loads up a load of stuff, the second step in that loading it loads the license code. I then want it so that if there is no license code installed it goes to a screen that tells them the limitations of not licensing and the two possible version they can purchase then gives them an option to purchase a license (takes them to our website) / Install a license or use the program in Trial mode.

The Trial mode will then function for unlimited amount of days but we place certain restrictions on features which is not a problem to do.


However what I have done so far instantly brings up one of your screens saying thank you for trying out product do you want to install a license code / continue evaulation (greyed out) or exit.

Is it possible to not use theis just use the add license screen when I need it.

I have copied the code from the sample project in the ApplicationEvents.vb and modfied the validation params for my program from ILS.

I then changed where the UpdateLicense() routine is to be on my splash screen so it runs when I want and in that routine I have a select case on the license.ProductInfo and what it does is write a verification string to a varible which the rest of the program will verify again and the license code and license status to other varibles and if the ProductInfo isn't either of two values sets my verification to "Trial" so my program knows its running in trial mode.

Is what I am trying to do possible and what am I doing wrong?


Thanks,
Max
_________________
M.Carpenter
DHCD Computing
www.dhcd.co.uk

Thank You
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Mon Oct 13, 2008 9:23 pm    Post subject: Reply with quote

You don't have to use the EvaluationForm if you don't need it. You can simply check for a license and if there is none, display the license install form. Here is what the code would look like:

Code:
        Private Sub MyApplication_Startup(ByVal sender As Object, ByVal e As Microsoft.VisualBasic.ApplicationServices.StartupEventArgs) Handles Me.Startup

            Dim provider As New EncryptedLicenseProvider
            _license = provider.GetLicense(LICENSE_PARAMETERS, _licenseFile)

            If _license Is Nothing Then
                InstallLicense()
            End If

            If _license Is Nothing Then
                ' display form notify them of trial restrictions etc
            End If

        End Sub

_________________
Infralution Support
Back to top
View user's profile Send private message Visit poster's website
max_carpenter



Joined: 04 Mar 2007
Posts: 21

PostPosted: Tue Oct 14, 2008 6:26 pm    Post subject: Still getting problems, Reply with quote

Ok I have modfied that as shown thanks I then have a peice of code like this:

Dim license As AuthenticatedLicense = My.Application.License

Code:
        Select Case license.ProductInfo
            Case
            Case
            Case Else
        End Select


(I have removed code to protect security)

It then errors on the line 'Select Case...' I have attached a screenshot


_________________
M.Carpenter
DHCD Computing
www.dhcd.co.uk

Thank You
Back to top
View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger MSN Messenger
Infralution



Joined: 28 Feb 2005
Posts: 5027

PostPosted: Tue Oct 14, 2008 9:12 pm    Post subject: Reply with quote

There is probably no license installed and hence My.Application.License is Nothing. You need to check for the possibility of license being nothing eg

Code:
if not license is Nothing then
    Select Case license.ProductInfo
    case "S"
    ...
end if

_________________
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