Decreasing the number of license activations - Advanced Installer Community

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!

dms
Posts: 164
Joined: Tue Aug 28, 2007 7:11 am
Location: UK

Decreasing the number of license activations

Hi

I've been using the approach outlined in your reglimit sample to control the number of times a licence can be activated for a couple of products very successfully now for a number of years. I'd now like to reverse the logic a bit so that when a user uninstalls a copy the number of activations is decreased. It should be relatively easy to augment the php script to achieve the desired result, my real question is where exactly in the unistall sequence would one call it , and would the uninstaller have sufficient information to pass to the script, or would I need to think about storing that information during the install and referencing it during the uninstall.

Dom
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Decreasing the number of license activations

Hi Dom,
It should be relatively easy to augment the php script to achieve the desired result,
I'm afraid is not, you would have to create your own custom action that calls the PHP script and makes the post operation. For our server side
validation process we have integrated in Advanced Installer a custom support for communicating with the server.

Window Installer custom actions support to launch only Win32 DLL, VBScript, JavaScript or EXE files. You cannot launch directly a PHP file, but only indirectly, for
example using a DLL to communicate with the MSI.

After you create your own DLL you can then add the custom action under the "Uninstall" standard action visible by default in the Custom Actions page.
The custom action should use the execution condition "REMOVE="ALL"", so its executed only during an uninstall.
and would the uninstaller have sufficient information to pass to the script
On this part you were right, you need to store the license information somewhere on the machine, so during the uninstall you can retrieve it using
a search or a custom action.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
dms
Posts: 164
Joined: Tue Aug 28, 2007 7:11 am
Location: UK

Re: Decreasing the number of license activations

Hi Bogdan

Thank you for the clarification. It looks as if I may have a bit of work to do. What are the chances of you exposing your integrated custom support for communicating with the server. After all if you did that then A! then gains an extra feature in so far as it suddenly becomes very easy to effectively tie an install to a set number of machines but give the end user the possiblity to de-activate on one and install on another whilst maintaining their total number of allowed licenses.

Consider this a feature request which I'd like implemented yesterday!!

Dom
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Decreasing the number of license activations

Hi Dom,
What are the chances of you exposing your integrated custom support for communicating with the server.
Practically nonexistent. We cannot reveal any of the code used by Advanced Installer or its features. The only thing I can say about this is that we use WinINet API.

However, you can use our data collector custom action to send information to your server. Our user guide contains the Collect installation data and send it to a web server how-to which may help you. It cannot be added directly in InstallExecuteSequence, but you can try this:
- create a New Attached Custom Action
- browse to the "custact\x86" subfolder from Advanced Installer installation folder
- select "DataUploader.dll"
- make sure that the Function Name field in Custom Action Properties pane is set to "SendCollectedData"

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
dms
Posts: 164
Joined: Tue Aug 28, 2007 7:11 am
Location: UK

Re: Decreasing the number of license activations

Hi Cosmin
It cannot be added directly in InstallExecuteSequence,
Does this mean that it could not be called from Uninstall in the Custom Actions page? All I really want to do is sent the serial number back to the same server that did the licence validation on install so that a new php script could decrement the number of activations accrued to that number by one.

Dom
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Decreasing the number of license activations

Hi Dom,

If you follow the steps from my previous post you will be able to add it in InstallExecuteSequence. You cannot add it directly, but there are workarounds.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
dms
Posts: 164
Joined: Tue Aug 28, 2007 7:11 am
Location: UK

Re: Decreasing the number of license activations

Hi Cosmin

I've been working on this over the course of the weekend and in the process have come across a few other points I'd like to clarify and also what I believe to be a flaw in the way that you are suggestiong server side validation be implemented (at least in the area of counting the number of activations). The flaw I have detailed seperately and enclosed in an e mail that I have sent to support marked for your attention.

The first thing I'd like to clarify is how to configure a search to run only at uninstall and not during the install. I also presumethat there will be some properties about which you cannot be certain at uninstall time so if I wanted, for example, to be absolutely certain that I would find a particular file I had created during the installation then the best place to put it so that it could be found during the search carried out during the uninstall would be somewaher like AllUsers\ApplicationData.

The second thing I'd need to do is ensure that there was an active internet connection during the uninstall, and if none were founnd warn the end user that if they were uninstallating in order to free up a license for use on another machine that they would need to connect to the internet first. Can this be done as things stand in AI at present. I can see for example that I can Add a pre-defined custom action 'Detect Process' and from that select the function name ActiveInternetConnection. I assume that this will actually check for the presence of an internet connction and that one would run it in 'Synchronos exectution, check return code mode' . If I check the 'Run only if an internet connection is found' box on the launch conditions page I see that it's making the following check AI_INTERNET_CONNECTION = "AI_INET_CON_SUCCESS" (when I look at the table editor) but I can see no way of setting the same for veryfying an internet connection at uninstal and then presenting the end user with a message box giving them the option to continue if none is found.

Dom
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Decreasing the number of license activations

Hi Dom,
The first thing I'd like to clarify is how to configure a search to run only at uninstall and not during the install.
This is not supported by Windows Installer by default. Searches are performed on both install and uninstall. Usually this doesn't matter. If you use them only during uninstall you can simply set custom names for them, for example PROPERTY_SEARCH instead of PROPERTY. This way they don't affect the install process.
The second thing I'd need to do is ensure that there was an active internet connection during the uninstall, and if none were founnd warn the end user that if they were uninstallating in order to free up a license for use on another machine that they would need to connect to the internet first.
For this you can try using our Internet connection custom action directly:
- add "aicustact.dll" from the "custact\x86" folder as an Attached custom action
- configure it to use "ActiveInternetConnection" function
- use a message box custom action to show the message you want
- use this condition for it:

Code: Select all

AI_INTERNET_CONNECTION <> "AI_INET_CON_SUCCESS"
This way the message box is shown only when an active Internet connection is not detected.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”