HadleyHope
Posts: 16
Joined: Fri Oct 11, 2013 3:22 pm

Trial.dll Return Codes

I cannot find a full list of return codes, what I want to check is the difference between a expired trial and the user cancelling the trial dialog.

0 = Licensed
2 = Valid Trial

I seem to be getting a return code of 5 if the dialog was cancelled, but not sure if that means that 4 means the trial has expired.

I have checked:
http://www.advancedinstaller.com/user-g ... using.html
http://www.advancedinstaller.com/user-g ... perty.html
http://www.advancedinstaller.com/user-g ... rties.html

None of which detail what codes 3, 4 and 5 mean (and whether there are any other codes above 5).


Thanks
Eusebiu
Posts: 4959
Joined: Wed Nov 14, 2012 2:04 pm

Re: Trial.dll Return Codes

Hi,

The codes that the "Trial.dll's" functions return are as follows:
  • 0 - valid license
    2 - valid trial
    4 - invalid license
    5 - no license
    8 - trial expired
    16 - invalid configuration, something unexpected/wrong happened
I'm afraid that we do not have a return code for the scenario when the user cancels the trial dialog. However, can you please tell us why do you need this, what is your scenario, so we can see if there is any workaround for it or if we can make an improvement?

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
HadleyHope
Posts: 16
Joined: Fri Oct 11, 2013 3:22 pm

Re: Trial.dll Return Codes

In a similar manner to the example project I am calling

Code: Select all

InitTrialReturn
to kick of the licensing check and then examining the result.

If the trial nag dialog is displayed the user can press the cancel button (or close the dialog) without doing anything (as well as pressing cancel on the registration dialog).

In the sample code:

Code: Select all

        uint ret = InitTrialReturn(kLibraryKey, process.MainWindowHandle);

        if (ret >= 4)
        {
            MessageBox.Show("Invalid mode to run");
            // disable the application 
            // Process.GetCurrentProcess().Kill();
        }
A value of 4 or greater is treated as an invalid mode to run, but if the trial period has not expired and the user has just cancelled the dialog (rather than click continue trial) the application should still run.
HadleyHope
Posts: 16
Joined: Fri Oct 11, 2013 3:22 pm

Re: Trial.dll Return Codes

Just noticed that if the user does cancel or close the dialog the license details have not been read, so none of the properties have not been set.

We have changed our code for a return value of 5 to display a message stating the user must either opt to continue the trial or register.
Eusebiu
Posts: 4959
Joined: Wed Nov 14, 2012 2:04 pm

Re: Trial.dll Return Codes

Hi,

We will make an improvement in a future version of Advanced Installer so that the application will still run if the user canceled the trial dialog. Thank you for your suggestion.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Daniel
Posts: 8276
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Trial.dll Return Codes

Hello,

This improvement was added in version 10.8 of Advanced Installer released on December 10, 2013.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”