AI 6.7 Licensing and Trial/registration

Having trouble running Advanced Installer? Got a bug to report? Post it all here.

AI 6.7 Licensing and Trial/registration

Postby bbcork » Fri Dec 05, 2008 1:51 am

I have a JAVA application that when installed will use the new Licensing/Trial/Registration features of AI 6.7

I want to add a menu item that will pop up the registration dialog at startup if not registered
And add a 'Register' menu item to facilitate registration keys

I've seen the C example....but, is there an equivalent for JAVA/JNI and a sample available
bbcork
 
Posts: 12
Joined: Fri Dec 05, 2008 1:34 am

Re: AI 6.7 Licensing and Trial/registration

Postby cosmin » Fri Dec 05, 2008 9:45 am

Hi,

Please note that you can add your Java product in the "Trialware Java Products" section of the Options tab in the Licensing page. This way the trialware code will be automatically inserted into the Java Launcher and you won't need to write any code in your application.

Regards,
Cosmin
Cosmin Pirvu
Advanced Installer Team
http://www.advancedinstaller.com/
cosmin
 
Posts: 4986
Joined: Tue Jul 10, 2007 6:39 pm

Re: AI 6.7 Licensing and Trial/registration

Postby bbcork » Fri Dec 05, 2008 11:43 am

Thanks,
I understand this...but...what happens in the scenario where

1. the user installs with a 30 day trial.
2. somewhere within the trial period they get a valid license key to register the product
3. how do they input the key as I can see any way of opening the Register Display
4. Every time I stop /start the product with a trial period...the Register Display does not open
should it? surely the frequency trigger does not need to happen before the registration display
opens

Also, it is not clear from the documentation....
What happens when the trial period has elapsed
Will the program terminate ?
What exactly is the criteria here?

Many thanks for response - I like the feature and want to get it right.
bbcork
 
Posts: 12
Joined: Fri Dec 05, 2008 1:34 am

Re: AI 6.7 Licensing and Trial/registration

Postby cosmin » Fri Dec 05, 2008 12:19 pm

Hi,

how do they input the key as I can see any way of opening the Register Display

The user can input the license key through the trial dialog shown when the application starts (it is the trial dialog in the "Display" tab of the "Licensing" page). If you want to have a separate menu in your application, you can use code which looks like this:
Code: Select all
public class MyClass {
....
    public native static short DisplayRegistration();
...
  public void showRegDlg() {   
    short ret = 2;
    ret = DisplayRegistration();
     if (ret == 0) // the user has provided a valid registration key
     ...
  }
  ...
}
This code can be added in your application for the menu item.

very time I stop /start the product with a trial period...the Register Display does not open
should it?

Yes, the registration dialog should be shown. Please note that the default display frequency is 30 percent (the dialog is shown only 30% of the times the application is launched). If you want to always show the dialog you can set the display frequency to 100 percent and check the "Show the trial message at first run" option.

What happens when the trial period has elapsed

When the trial period expires the registration dialog will always be shown. However, the "Try" button will be deactivated (the available options will be "Register" and "Buy").

Regards,
Cosmin
Cosmin Pirvu
Advanced Installer Team
http://www.advancedinstaller.com/
cosmin
 
Posts: 4986
Joined: Tue Jul 10, 2007 6:39 pm

Re: AI 6.7 Licensing and Trial/registration

Postby bbcork » Fri Dec 05, 2008 1:09 pm

Many thanks Cosmin

Last question....

Is there any way for the application to hook the trial period has elapsed
I know the Reg Dialog will appear as you've explained....
but, I want to the executing application to terminate on the elapse trigger.

If I was to add a timer, is there a way I can query to find is trial is finished
I know you said the Reg Dialog will appear...but, it would be cool if the
'trialed' application would also have the ability to shutdown.
At least then on a restart the Buy/Register options are all that is available.

Again, your answers are exactly what I need.
Many thanks.
bbcork
 
Posts: 12
Joined: Fri Dec 05, 2008 1:34 am

Re: AI 6.7 Licensing and Trial/registration

Postby cosmin » Fri Dec 05, 2008 1:31 pm

Hi,

If the trial period expires, the registration dialog will always be shown with the "Try" button disabled. Therefore, the user will not be able to launch the application through the "Try" button. Basically, after the trial expires the application cannot be launched anymore. So there is no reason to check in the application if the trial expired because the application will not be launched.

Regards,
Cosmin
Cosmin Pirvu
Advanced Installer Team
http://www.advancedinstaller.com/
cosmin
 
Posts: 4986
Joined: Tue Jul 10, 2007 6:39 pm

Re: AI 6.7 Licensing and Trial/registration

Postby bbcork » Mon Dec 08, 2008 7:41 pm

Hi again,

I'm having a little issue using the Trial.dll

Q1:
For Java versions after 1.4 (I think) it is illegal according to JLS to refer to a class in the default or unnamed package from another class that is in package...

You DLL when I look at the export table....

DisplayRegistration (....)

suggests that it needs to be referenced from the default package, as the normal <classname>_<method>
does not appear to be followed here.
As JB/Eclipse will not allow me to refer to this method from a class in the default package that loads the library,
I'm having some issues - explicitly the ?UnsatisfiedLinkError when I try to call the method from within another class
inside a package....

Can you help out here - if the method must be called from inside a package ?
Due to the JB/Eclipse making a test class in the default package unresolved from the calling class...
the current implementation seems broken for me.

Do you have full test code from within a package that works for this.
Any help appreciated.
bbcork
 
Posts: 12
Joined: Fri Dec 05, 2008 1:34 am

Re: AI 6.7 Licensing and Trial/registration

Postby kkim » Mon Dec 08, 2008 11:13 pm

Hi,

I'm glad that someone is trying out this new feature.

What happens if someone tries to change the system clock? Will it trick AI into thinking the trial will last longer?

Also, after the trial period ends, what happens if someone uninstalls the product, and re-installs the product? Will it start
from scratch again?

I guess I'm trying to figure out how "clever" this new feature is...

thanks!!!
kkim
 
Posts: 44
Joined: Thu Apr 12, 2007 3:58 pm

Re: AI 6.7 Licensing and Trial/registration

Postby dms » Tue Dec 09, 2008 8:32 am

Kim

Having spent rather a lot of time with this feature over the past few days I can at least answer one question directly and surmise at your second but would suggest that you wait for a definitive answer from The Advanced Installer Team rather than take my word for it.

I actively installed the trial Test Example three days ago and (after confimation from Cosmin) I learnt that the time trial is Hourly based. In other words if you install at 5.00 pm on day one the first full day of your trial does not end unti after 5.00pm the next day and so on. If you do not register thet trial but use it for a couple of days, then uninstall and reinstall it you will not gain any extra time, in other words it knows when you made the original installation. That suggests to me that they have probably taken the 'user alters the system clock scenario' into consideration but I haven't tested that and can't comment on it as yet.

As things stand at present you need to decide how you choose to handle new versions installed during the trial period (do you extend the trial or simply let it continue as is or even allow it to strat afresh. Much of that will depend on how you choose to implement the generation of registration keys and the public / private keys that are used to do that. In other words You need to have a coherent policy for the way that you want to implement trial periods for your products and you need to plan your builds around that. As I see it this feature is capable of accommodating most of the different scenarios that you could come up with but it's successfull implementation will be dependent upon you the developer following a coherent plan from the outset. I don't see this as a fault in any way rather as an indication of just how important it is for us as developers to have a coherent strategy in place for both how we wish to distribute and license / register our products. If you have thought this ought carefully at the outset implementing in AI will prove to be a doddle.

The feature integrates well with Visual Studio based projects (I myself have been using in in VB.net based projects) and I am aware that there are more feautures / improvements that will be made to this. I have not tried in in any Java Based projects largely because Java remains a 'foreign' language to me, something I suppose I ought to rectify but never quite seem to find the time to do. All in all it's a great addition to Advanced Installer and I know it will make a huge difference to a number of my applications.

HTH

Dom
dms
 
Posts: 83
Joined: Tue Aug 28, 2007 7:11 am
Location: UK

Re: AI 6.7 Licensing and Trial/registration

Postby cosmin » Tue Dec 09, 2008 3:07 pm

Hi,

bbcork wrote:As JB/Eclipse will not allow me to refer to this method from a class in the default package that loads the library,
I'm having some issues - explicitly the ?UnsatisfiedLinkError when I try to call the method from within another class
inside a package....

Please note that this feature will not work if the application runs from the IDE (Eclipse for example). In order to test the feature you can build the JAR files, create the Java Product in Advanced Installer, configure the licensing for it and install the package.

The main class of your Java application should contain the declaration of the DisplayRegistration() function:
Code: Select all
public native static short DisplayRegistration();

Also, in the main class the function should be used:
Code: Select all
public void showRegDlg() {
    short ret = 2;
    ret = DisplayRegistration();
    if (ret == 0) // the user has provided a valid registration key
}

With this code added to the main class, you can now call the showRegDlg() function from anywhere in the application when you want to show the registration dialog. I'm not sure how your classes are organized, but using this code shouldn't break any rules.

kkim wrote:What happens if someone tries to change the system clock? Will it trick AI into thinking the trial will last longer?

No, the licensing feature is independent of the system clock.

kkim wrote:Also, after the trial period ends, what happens if someone uninstalls the product, and re-installs the product? Will it start from scratch again?

No, the license information remains on the machine after an uninstall. Therefore, the elapsed trial period will stay the same even if the application is reinstalled.

Regards,
Cosmin
Cosmin Pirvu
Advanced Installer Team
http://www.advancedinstaller.com/
cosmin
 
Posts: 4986
Joined: Tue Jul 10, 2007 6:39 pm


Return to Common Problems

Who is online

Users browsing this forum: cosmin, Yahoo [Bot] and 2 guests