I found this article, where the answer appear to be what I'm after. Basically, I call out to the "Trial.dll" library and make use of the return values of the functions to decide how my forms should behave.
http://www.advancedinstaller.com/forums ... =2&t=21295
To summarise:
All is well up until the trial has expired. I've got the Trial Frequency value set to 0, so that the AI dialog never appears. If the trial has expired and I call out to the *ReadSettingsStr* function, my application just exits; there's no exception, it just exits. I'm guessing it's calling something like Process.Kill() under the hood. This appears to be the same behavior as if I had clicked the "Cancel" button when I show the built in dialog.- set the trial frequency to 0 days so our dialog is never shown (Licensing Display Options tab)
- use the ReadSettingsRetStr property mentioned in How do I integrate the licensing support in my application? article
-> if its value is 0 it means the product is already registered and there's no need to show your custom dialog
-> if its value is 2 you should enable the Try button ; to display the days left you can retrieve TrialLeft property (Trial and Licensing Properties) using the method described in How do I interrogate the licensing library to get license information? article
-> if its value is greater or equal than 4 you should disable the Try button, leaving Register and Buy
If I set the "Trial Frequency" to 100 in the AI project, the built in dialog appears and lets me provide a registration code. After that, my application loads without problem.
Is there something special I need to do to stop the application from getting closed?
FOLLOW US
Get the latest news in Application Packaging