How to manually display the registration dialog - Advanced Installer Community
jeremy.vignelles
Posts: 9
Joined: Fri Nov 14, 2014 11:03 am

How to manually display the registration dialog

Hi,
I'm continuing my tests on advanced installer but I've got another question:

I have two applications:
  • A service, which must be secured by the licensing system.
  • A configurator, where the user can register
I set the Display frequency percent to 0, in order to hide the dialog when the service starts, but I'd like to display the dialog in the configurator when I call "DisplayRegistrationStr". (By the way, what's the difference with DisplayRegistration and DisplayRegistrationStr?)
However, the dialog isn't displayed. Is it possible to do this?
Alternatively, is it possible to get the generated COMP_ID from the trial.dll so I can manually send the e-mail or generate a file that will be sent (the target computer doesn't necessarily have access to Internet)?
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: How to manually display the registration dialog

Hello,

First of all I apologize for such delayed reply, but recently we are quite busy.
I set the Display frequency percent to 0, in order to hide the dialog when the service starts, but I'd like to display the dialog in the configurator when I call "DisplayRegistrationStr". (By the way, what's the difference with DisplayRegistration and DisplayRegistrationStr?)
However, the dialog isn't displayed. Is it possible to do this?
This is the normal behavior. When setting the display frequency to 0 the trial dialog won't be displayed at all. In this case you should create your own custom trial dialog. Please take a look on the "Advanced Installer using my custom form for trial.dll" thread which expose what approach you can use.

Regarding the difference between the "DisplayRegistration" and "DisplayRegistrationStr", assuming you are integrating Licensing support in a C# or VB.NET application, our trial.dll is developed in C++. The "DisplayRegistration" is a C# function which, when called within your C# code, will call the exported "DisplayRegistrationStr" C++ function of the "trial.dll".

The "DisplayRegistrationStr" is a function (of our "trial.dll") which displays (if necessary) the registration dialog. Now, in order to call the "DisplayRegistrationStr" function within a C# code you should import it and link with a C# function (i.e. DisplayRegistration). Then, in order to call the "DisplayRegistrationStr" C++ function within your C# code you should use the "DisplayRegistration" function (which will just call the exported C++ function). Please take a look on the "Managed Exe calling Native Dll using import" article section which should be useful for you.
Alternatively, is it possible to get the generated COMP_ID from the trial.dll so I can manually send the e-mail or generate a file that will be sent (the target computer doesn't necessarily have access to Internet)?
Yes, this can be done. You should just access the "COMP_ID" property of our licensing library. Please take a look on our "Retrieve Licensing Elements" article.

If you have any questions just let us know.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
jeremy.vignelles
Posts: 9
Joined: Fri Nov 14, 2014 11:03 am

Re: How to manually display the registration dialog

Hi,
Thanks for your reply.

As your documentation says, the COMP_ID property can only be accessed if a valid licence is entered, and not in the trial mode. Indeed, when I'm trying to get this data, I'm getting the error code 13 (ERROR_INVALID_DATA).

If I'm understanding correctly, once I've received the licence by mail, I need to implement a method that puts this licence into the registry key manually? Is there a way to do it with the trial.dll ?

Regards
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: How to manually display the registration dialog

Hello,

I apologize for my misleading answer. Indeed, the "COMP_ID" is a license property and is available only after a license was registered on local machine. If you need to access the computer ID of local machine during the trial mode (before a license is registered), then you should access the "CompId" property (this is an undocumented licensing library specific property). Will update this info in our user guide article in a future version of Advanced Installer.

Let us know if this helped.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
jeremy.vignelles
Posts: 9
Joined: Fri Nov 14, 2014 11:03 am

Re: How to manually display the registration dialog

This helped a lot, thanks!
I made a test program and I'm able to activate it with my software.
I will let you know if I need further help :)

Regards
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: How to manually display the registration dialog

You're always welcome.

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

Return to “Common Problems”