mpande
Posts: 41
Joined: Tue Sep 28, 2021 1:52 pm

Using licenses to control upgrades

Tue Jan 25, 2022 4:06 pm

We have been looking into using licenses to control upgrades. Our update file contains the following

---
;aiu;

[General]
LicenseIdCheckURL = https://oijrlskdjfglkjsdfglksjdfg.net/
LicenseCheckFlags = FailOnServerError|FailOnWrongRetCode

[Whatever 2021.58.125]
Name = Whatever 2021.58.125
(More information below, but nothing dealing with licenses)
---

Given that the site https://oijrlskdjfglkjsdfglksjdfg.net/ doesn't actually exist, I would expect any upgrade to be rejected, but running just updater.exe with no arguments still downloads and runs the upgrade. Is there something we are missing in our update text file configuration or a misunderstanding on how this license check works?

Liviu
Posts: 367
Joined: Tue Jul 13, 2021 11:29 am
Contact:  Website

Re: Using licenses to control upgrades

Thu Jan 27, 2022 10:05 am

Hello Max,

I have tested this and I was indeed able to replicate the behavior.

Unfortunately, I can not say for sure why this is happening. That seems to be a limitation of Advanced Installer.

Please give me some more time to discuss this with our development team and I will get back to you as soon as I have more information.

Thank you for your patience.

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

mpande
Posts: 41
Joined: Tue Sep 28, 2021 1:52 pm

Re: Using licenses to control upgrades

Thu Jan 27, 2022 6:07 pm

Thanks! To be clear, while I posted the example above, I've been unable to get the upgrade to be rejected when putting in valid information. My assumption is that putting in a valid url, with a webservice that returns the proper values (601,602, 603), and then running a command from the command line:
Updater.exe HKLM\SOFTWARE\Wow6432Node\MyKey\License
would reject if the license wasn't valid, but so far the upgrader has been running no matter what.

mpande
Posts: 41
Joined: Tue Sep 28, 2021 1:52 pm

Re: Using licenses to control upgrades

Tue Feb 01, 2022 4:01 pm

Hi! I just wanted to check on the status of this.

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

Re: Using licenses to control upgrades

Wed Feb 02, 2022 4:28 pm

Hi,

Sorry for the delayed reply on this.

Please note that when you want to search for your license in registry you should call the Updater with a command like this:

updater.exe /command HKLM\SOFTWARE\Wow6432Node\MyKey\License

where /command is one of the Updater Command-line option. Just check the available command in the "Command-line option" table of our Updater documentation.

For instance you can use a command line like this:

updater.exe /checknow HKLM\SOFTWARE\Wow6432Node\MyKey\License

Now in what regards rejecting the updates when your license check server is not accessible or it returns an unknown return code, to achieve this behavior please proceed like this:

1. open your updates configuration project and go to "Advanced " page

2. make sure you check the "Block updates install when License Check URL is unreachable" and "Block updates install when License Check script returns a unknown code" options
Screenshot 2022-02-02 172503.jpg
Screenshot 2022-02-02 172503.jpg (53.19KiB)Viewed 1097 times
3. rebuild your updates setup project and host the updates config file on your web server again

Let me know how this works for you.

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

mpande
Posts: 41
Joined: Tue Sep 28, 2021 1:52 pm

Re: Using licenses to control upgrades

Tue Mar 01, 2022 5:38 pm

I had thought I had done the exact things specified in the response before, but I tried them again after 19.2 and got different behaviour(I might have been doing subtly different that I don't remember now).

When I try now I'm getting the response saying the script is blocked because the license check URL is not available. But the URL is available. Using the same lab machine I can post to it with either
https://nabhospengwhitelister2022011309 ... uageid=501 (603 Response)
or
https://nabhospengwhitelister2022011309 ... uageid=501 (601 Response)

I've got the values set in the update text file set as
;aiu;

[General]
LicenseIdCheckURL = https://nabhospengwhitelister2022011309 ... sites.net/
LicenseCheckFlags = FailOnServerError|FailOnWrongRetCode

Should I be using a different value for the URL?

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

Re: Using licenses to control upgrades

Wed Mar 02, 2022 10:49 am

Hi,

Accordingly to the POST URL you are testing the LicenseIdCheckURL flag should be set to the following URL address:

Code: Select all

https://nabhospengwhitelister20220113095929.azurewebsites.net/wlMidCheck
Is it your LicenseIdCheckURL a public URL? I'm asking this because when I try to access it, e.g.

Code: Select all

https://nabhospengwhitelister20220113095929.azurewebsites.net/wlMidCheck?licenseid=13130032773527&languageid=501
from my web browser (on a test machine) I get an HTTP 405 error.

Please note that when our Updater will send an HTTP post to your web server, e.g. using an HTTP post URL like this

Code: Select all

https://nabhospengwhitelister20220113095929.azurewebsites.net/wlMidCheck?licenseid=13130032773527&languageid=501
your web server script should respond with one of these answer codes: 601, 602 and 603. So, please make sure that when running an HTTP POST URL like this

Code: Select all

https://nabhospengwhitelister20220113095929.azurewebsites.net/wlMidCheck?licenseid=13130032773527&languageid=501
your web server script does respond with one of the above answer codes.

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

mpande
Posts: 41
Joined: Tue Sep 28, 2021 1:52 pm

Re: Using licenses to control upgrades

Wed Mar 09, 2022 7:49 pm

Thanks! You've pointed us in the right direction. We had not understood the information was contained in the body of the request. Now that we've got this working, we're encountering something we don't understand. Checking the license using a registry key contains some values we don't understand. For example if our license code is a registry key of type REG_SZ with a value of 711000, doing a request with the following command line:
c:\Directory\>Updater.exe /silentall -nofreqcheck -nogui HKLM\SOFTWARE\WOW6432Node\Directory\LicenseId
sends the following to our webservice:
licenseid=711000%0%0આ%0%0&languageid=1033&version=2.1
We're getting values we don't recognize between the licenseid and the language id field. Are we safe in assuming that "%" indicates the license is over? Is there something we should be doing to prevent these extra characters from coming across?

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

Re: Using licenses to control upgrades

Mon Mar 14, 2022 10:30 am

Hi,

Sorry for the delay on this.

I have tested the scenario and replicated the behavior with extra characters added at the end of the license string get from registry. Please give me a few more time to debate this with my dev team and as soon as I have a conclusion I will get back to you.

Thank you for your patience and understanding.

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

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

Re: Using licenses to control upgrades

Tue Mar 22, 2022 12:49 pm

Hi,

The above issue was fixed starting with Advanced Installer 19.3 version released on March 21st, 2022.

When you have the time please run a test and let us know how this works for you now.

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

Return to “Common Problems”