fkus
Posts: 27
Joined: Fri Jan 04, 2019 7:38 pm

License Validation on a Virtual Machine

Tue Jul 14, 2020 9:11 pm

Hi,

Recently I started having issues with license validation on virtual machines.

Specifically, a license that I generate for my application that uses Advanced Installer will not work if my application is installed on a Virtual Machine.

The same application can validate a license if run on a desktop, and the same virtual machine has previously been able to validate a license for this application.

Note that I generated licenses from both the Advanced Installer client and my own license generation client

Have you experienced this issue before? If so what have you done to resolve it? If not, what do you need from me to better understand the problem and help resolve it?

Our application is used quite frequently on virtual machines, it would severely impact our reach if this issue cannot be resolved.

Thank you,

Francis

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: License Validation on a Virtual Machine

Mon Jul 20, 2020 10:35 am

Hello Francis,

Unfortunately, I can not say for sure why this happens.

During the registration, do you receive any error messages? If so, could you please take a screenshot of the message and forward that to me?
Have you experienced this issue before? If so what have you done to resolve it? If not, what do you need from me to better understand the problem and help resolve it?
To be fully honest with you, I did not encounter such a behavior in the past. Could you please forward me the following:

- a copy of your .AIP file

- a download link for your setup

- a test case which I can follow in order to reproduce this issue (if a key is required, please also forward me one)

by e-mail at support at advancedinstaller dot com so I can further investigate and test this on our end?

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

fkus
Posts: 27
Joined: Fri Jan 04, 2019 7:38 pm

Re: License Validation on a Virtual Machine

Tue Sep 01, 2020 6:07 pm

Hi Catalin,

Sorry for the late reply, it has been a busy couple of months.

I encountered the same problem on a spare laptop we had lying around our office (not on a VM!), so I'm revisiting it now. I did a bit more digging (adding more detail to our registration step in our application). Here's what's going on:

We created a custom registration window that allows the user basic access to the application without a license (access to a help file, our organisations information, etc). As a result, we call the InitTrial method ourselves upon manual registration:

Code: Select all

        [DllImport("Licensing.dll", EntryPoint = "ReadSettingsRetStr", CharSet = CharSet.Ansi)]
        private static extern uint InitTrial(string aKeyCode, IntPtr aHWnd);
What's happening is that this code is always returning a value of 5 for this machine, despite the fact that the exact same code is working fine on other machines (i.e. it is parsing the license signature correctly and registering the application without issue). I have tried running my application as administrator, the issue persists.

One thing to note is that all the machines on which I am having issues (both real and virtual) are quite dated - either running Windows 7 or were recently upgraded to Windows 10 from Windows 7.

Francis

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: License Validation on a Virtual Machine

Mon Sep 07, 2020 9:12 am

Hello Francis,

Thank you for the provided files.

I have done some tests, but unfortunately I was not able to replicate the described behavior.

trial.png
trial.png (137.83KiB)Viewed 4853 times

What I have noticed, however, is that the application itself is throwing an error if you do not launch it as administrator (i.e. its' shortcut).

Unfortunately, I can not say for sure why this happens and the application terminates before I can read anything. However, based on the eventvwr, here are the errors:

Code: Select all

Application: Hawkview.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.UnauthorizedAccessException
   at System.IO.__Error.WinIOError(Int32, System.String)
   at System.IO.FileStream.Init(System.String, System.IO.FileMode, System.IO.FileAccess, Int32, Boolean, System.IO.FileShare, Int32, System.IO.FileOptions, SECURITY_ATTRIBUTES, System.String, Boolean, Boolean, Boolean)
   at System.IO.FileStream..ctor(System.String, System.IO.FileMode, System.IO.FileAccess, System.IO.FileShare, Int32, System.IO.FileOptions, System.String, Boolean, Boolean, Boolean)
   at System.IO.StreamWriter.CreateFile(System.String, Boolean, Boolean)
   at System.IO.StreamWriter..ctor(System.String, Boolean, System.Text.Encoding, Int32, Boolean)
   at System.IO.StreamWriter..ctor(System.String)
   at Advosol.EasyUA.ConfigUtils.CreateDefaultConfigurationFile(System.String, System.String)
   at LibOPCUA.StaticMethods.initializeUaConfigFile(System.String, System.String, System.String)
   at LibHawkview.AppBackend.AppBackend..ctor(System.String, Boolean)
   at LibHawkview.App.Application.run(System.String[], Boolean)
   at ExeLauncher.Program.Main(System.String[])

Code: Select all

Faulting application name: Hawkview.exe, version: 6.1.2.0, time stamp: 0x5f4e6aa9
Faulting module name: KERNELBASE.dll, version: 10.0.18362.535, time stamp: 0x50cc8d5a
Exception code: 0xe0434352
Fault offset: 0x000000000003a839
Faulting process id: 0x20f4
Faulting application start time: 0x01d684ea89119139
Faulting application path: C:\Program Files (x86)\Enero Solutions Inc\Hawkview Collector\Hawkview.exe
Faulting module path: C:\Windows\System32\KERNELBASE.dll
Report Id: f2bb9660-a67e-447f-8fbf-ce0bd13e2df0
Faulting package full name: 
Faulting package-relative application ID: 
Everything worked as expected after I launched the shortcut as administrator.

Hope this helps somehow.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

fkus
Posts: 27
Joined: Fri Jan 04, 2019 7:38 pm

Re: License Validation on a Virtual Machine

Wed Sep 23, 2020 3:30 pm

Hi Catalin,

This issue is becoming more and more common. It is not something I can reproduce on just any machine, I have a collection of 3-4 laptops and some other VMs where the issue occurs. I'm concerned that it might happen on a client machine, and that we have absolutely zero way of fixing the issue (note that we have been using Advanced Installer in the same way for about 2 years with no issues until recently).

Is there a time we can schedule a Teams meeting to discuss this real time, and that I may provide a demo of the issue?

Thanks,

Francis

fkus
Posts: 27
Joined: Fri Jan 04, 2019 7:38 pm

Re: License Validation on a Virtual Machine

Fri Sep 25, 2020 4:10 pm

A thought occurred: I think all the machines on which I am having issues have another user account on which my application was previously installed/licensed. Is it possible there is some kind of interaction here? Is validation using the machine ID from one user account, while the reported machine ID (used to generate the license) is using another?

I'm just spitballing here, but if I cant resolve this soon I will have to look at alternative solutions...

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: License Validation on a Virtual Machine

Wed Sep 30, 2020 2:34 pm

Hello Francis,

Unfortunately, we do not really do live support, as most of the times we can not give an answer immediately and investigating an issue is time consuming. Also, our schedule is pretty busy as for this moment.

Thank you for your understanding!

Now, in what regards your issue, if I understand correctly:

- you install your application

- run the shortcut as administrator --> the application enters in trial mode for 30 days

- you go to "Help" --> "About" --> "Register" --> enter the key --> it gives an error?

In my earlier tests, I have only tested the application entering trial mode. However, (please correct me if I'm wrong), your problem is with registering the application.

In order for me to further investigate this, could you please generate a license key for me and forward it by e-mail at support at advancedinstaller dot com?

My Machine ID would be (based on the dialog spawned when the "Register" button is pressed): 5915972658294149
A thought occurred: I think all the machines on which I am having issues have another user account on which my application was previously installed/licensed.
As for this moment, I can not really say if this may or may not be the reason. However, I will for sure test this scenario.

Looking forward to hearing from you!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

fkus
Posts: 27
Joined: Fri Jan 04, 2019 7:38 pm

Re: License Validation on a Virtual Machine

Tue Oct 13, 2020 3:56 pm

Hi,

I have send the license to the email provided. Let me know how things go!

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: License Validation on a Virtual Machine

Tue Oct 20, 2020 7:37 pm

Hello Francis,

First of all, please accept my apologies for the delayed reply (this took more than expected to test).

Unfortunately, I was not able to reproduce the behavior on my end (not even with your scenario).

The only thing left that I can think of is that there is indeed a typo in the license key. In order for me to further investigate this, could you please proceed as it follows:

- open your application on a machine where this reproduces

- try to register it

- right before hitting the "Apply" button, please copy the license (e.g. CTRL+A & CTRL+C) and paste it in a text editor. Save the file.

- now please open the Registry Editor (regedit.exe) and go to the following key:

Code: Select all

HKEY_CURRENT_USER\Software\[Manufacturer]\[ProductName]
The above key should contain the "Registration Key" value.

- please right click on the key (in our case, that would be "Hawkview Collector") --> "Export"

- please zip the exported key together with the text file and forward them to me by e-mail at support at advancedinstaller dot com.

When a license key is verified, the above registry key is querried. My assumption here would be that, due to the copy-paste mechanism, some characters (hidden) are added to the string, therefore invalidating it.

Looking forward to hearing from you!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

fkus
Posts: 27
Joined: Fri Jan 04, 2019 7:38 pm

Re: License Validation on a Virtual Machine

Fri Oct 23, 2020 7:31 pm

Hi,

Apologies for the delay, I was only able to get my hands on one of the problematic machines this afternoon. I have checked the saved registry key and it looks to be the same as the information I fed into the registration library.

I have attached the requested .zip file with the exported registry key and the text file of the license block.

Please let me know what else I can do to help!

Francis
Attachments
hawkview license.zip
exported registry and saved text file of license
(737Bytes)Downloaded 192 times

fkus
Posts: 27
Joined: Fri Jan 04, 2019 7:38 pm

Re: License Validation on a Virtual Machine

Tue Oct 27, 2020 3:38 pm

Hi Catalin,

Any news on this front?

Our Advanced Installer support license is expiring soon and we are currently evaluating if we want to renew it. Truthfully, if we cannot resolve this issue soon, we will need to look elsewhere for a licensing solution.

Francis

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: License Validation on a Virtual Machine

Tue Oct 27, 2020 4:11 pm

Hello Francis,

Thank you for the provided files.

It looks like the strings are the same, therefore this does not look to be the issue here.

Unfortunately, since I was not able to reproduce this behavior on my machine, I might need you to try and isolate the behavior.

Could you please try to remove the "Computer Specific" option ("Licensing" page --> "Licensing" --> "Registration" tab --> "License Format" section) from your project and re-test the scenarios?

Are you guys generating the license before registering the product, or are you using some license that was previously generated?

In my tests, I was always generating the license (using "Generate Registration Keys") before registering the product using the Computer ID generated by the "Help" --> "About" window.

I am thinking that perhaps the Computer ID has changed, therefore the license previously generated is no longer valid.

P.S.: I apologize this is taking this long, but unfortunately we can not really do much without being able to reproduce the issue on our side.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

fkus
Posts: 27
Joined: Fri Jan 04, 2019 7:38 pm

Re: License Validation on a Virtual Machine

Tue Oct 27, 2020 6:30 pm

Hi Catalin,

We are generating the license just prior to registering the product (i.e. a new license every time we try registering, using the computer ID provided by the license library at the time of registration).

I exposed the error code in the application and tried a few things in addition to removing the computer ID. Here are the results:

Full License (i.e. no change): Error with Registration Status: 5
Removing Computer ID (all else unchanged): Error with Registration Status: 5
Removing the Expiration Date (all else unchanged, i.e. with computer ID): Registration successful
Removing the OPC criteria (all else unchanged): Registration Status: 5
Removing the Analysis criteria (all else unchanged): Registration Status: 5
Removing the Model/Tuning criteria (all else unchanged): Registration Status: 5

I'm fairly convinced the error is in the expiration date. Is it possible there is some kind of localization happening in the licensing library?

Note that I previously experienced issues with the expiration date, but I had resolved them locally by ensuring that my application always used CultureInfo.InvariantCulture when converting the DateTime to a string to pass to the library (we have several clients who operate on French operating systems).

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: License Validation on a Virtual Machine

Fri Oct 30, 2020 2:04 pm

Hello Francis,

First of all, thank you very much testing and isolating this issue.
Is it possible there is some kind of localization happening in the licensing library?
I can not really say for sure, but this looks to be the case here.

Please note I have emailed you a .ZIP archive containing the two Trialware.dll files (x64 and x86).

Please replace them in the specified folder, rebuild and retest the setup on the faulty machines and let me know if everything is working as expected.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

fkus
Posts: 27
Joined: Fri Jan 04, 2019 7:38 pm

Re: License Validation on a Virtual Machine

Mon Nov 02, 2020 2:49 pm

Hi Catalin,

As per the email I sent you (in reply to the two Trialware.dll files you provided), the issue is persisting (has not been resolved).

Please advise on next steps.

Thanks,
Francis

Return to “Common Problems”