We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

colinbrown
Posts: 2
Joined: Thu Aug 21, 2014 9:44 pm

Can a "Uses Limited" trial be used for app features?

I have a "Time Limited" trial that allows our c++ application to be used for 30 days.
We also want to limit a specific feature in our software to 30 uses (not the whole software). I made another trial and have it all linked up, but it seems that the "Uses Limited" counter is decremented every time the dll is loaded. Is it possible to read the "TrialLeft" property value without decrementing and call a different method to actually consume a use?
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Can a "Uses Limited" trial be used for app features?

Hello and welcome to Advanced Installer forums,

Thank you for your interest in Advanced Installer.

I'm afraid this is our default behavior. The "TrialLeft" property value is incremented every time the "ReadSettingsStr" or "ReadSettingsRetStr" functions from our trial DLL are called to initialize the license library. Also, in order to access a trial property you need to initialize the license library first.

As a workaround, in order to achieve what you need, you can save the trial property values into a registry zone or in a file after every call of the licensing library. Then, before making the next call of the licensing library you can access the previous stored properties (in a registry or in a file), call your own method to consume or not a use and afterwards, based on your usage method result call or not the licensing library again.

Let us know if this helped.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
colinbrown
Posts: 2
Joined: Thu Aug 21, 2014 9:44 pm

Re: Can a "Uses Limited" trial be used for app features?

Thanks for the solution! I was saving values to a file beforehand so I just reused that code. Below is my pseudocode;

Code: Select all

if (fileValue > 0)
    doComputations();

// doComputations() was successful
initializeAdvancedInstaller();

if (AdvancedInstaller.TrialLeft == 0) {
    discardResults();
    fileValue = 0;
} else
    fileValue = AdvancedInstaller.TrialLeft - 1; // since TrialLeft is the value before decrementing
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Can a "Uses Limited" trial be used for app features?

You're welcome. I'm glad you sorted this out.

Thank you for posting the your pseudocode solution. Certainly this will help future users in the same situation.

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

Return to “Building Installers”