Product activation question - Advanced Installer Community
MasterGameZ
Posts: 4
Joined: Tue Jun 14, 2016 8:40 pm

Product activation question

Hello,
I am using Server Side Product Activation, and I enabled the maximum validations for serial numbers for only 1 activation but I was wondering if someone uninstalls the program, how I remove 1 from the amount of times the code they used have been activated on the mySQL database.
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Product activation question

Hi and welcome to our forums.

In order to change the maximum validation value when the user uninstalls the application you can go in the "Custom Actions" page and add "Send install information to your web server" predefined custom action that will be executed only when the product is uninstalled.

This custom action will send some information to a URL that will made the necessary changes in your database. For more details you can take a look on the "How do I collect installation data and send it to my web server" tutorial.

Just let us know if you have any other question.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
MasterGameZ
Posts: 4
Joined: Tue Jun 14, 2016 8:40 pm

Re: Product activation question

Hello, Thank you for the reply but I don't exactly understand how to do what I said. So what PHP code do I put? And what do I do after I pressed the Send install information to your web server
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Product activation question

Hi,
So what PHP code do I put?
You need to create yourself a PHP script that connects to your database and modifies the maximum validation value related to the user that uninstalled the application.
And what do I do after I pressed the Send install information to your web server
You just need to add the "Send install information to your web server" custom action in the "Custom Actions" page of your project and set it to be executed only on uninstall. It will send some POST variables to the PHP script that you created and that script will make the changes in your database based on the information that it received. Please read the "How do I collect installation data and send it to my web server" tutorial that I mentioned above.

Just let me know if you need more details.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
MasterGameZ
Posts: 4
Joined: Tue Jun 14, 2016 8:40 pm

Re: Product activation question

Hello, Can you please tell me the code i need to write to do this? Like a template or something because i am bad with php
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Product activation question

Hi,

Some PHP script examples to validate your license and to also increase the validation number during each installation are available in the "How do I configure server-side serial number validation" article. You can also download them using the link from the bottom of that page.

So, in order to decrease the validation number during the uninstall you can use the "validateLimit.php" script from that example and modify the line "107" to subtract "1" from the appropriate row:

Code: Select all

$inc_val_no_query = sprintf("UPDATE `%s` SET `%s` = `%s` - 1 WHERE `%s` = '%s'",
Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”