ehardin
Posts: 85
Joined: Fri Jul 13, 2007 8:10 pm

Licensing InitLicensingSupport readSettingsProc Error

Mon Jun 24, 2019 8:28 pm

Trying to setup Licensing in a VS 2013 MFC MDi project.
In the InitLicensingSupport() function the call to
int ret = readSettingsProc(aKeyCode, aHWnd);
will crash the program.
The call to InitLicensingSupport() is made from the OnInitialUpdate()
The aKeyCode is the one copied from AI -> Licensing -> Registration tab -> Library Key
The aHWnd is m_hWnd
The Error is Unhandled exception at 0x002570B8 in <my.exe> : 0xC0000005: Access violation executing location 0x002570B8.

I had compiled the AI project and installed from that to the development machine. Running the application after install just crashes.
I copied the trial.dll to my VS 2013 project and ran in Release mode and it crashes. In Debug mode I can see the error code

Any ideas?

Ed

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

Re: Licensing InitLicensingSupport readSettingsProc Error

Tue Jun 25, 2019 3:03 pm

Hello Ed,

I am not so sure why this happens. Can you replicate the issue on multiple machines? Maybe there is something corrupted on the related machine. The correct route to test this out is to launch your application after it is installed alongside the trial.dll through the setup package.

If you could consistently replicate the issue it will be very useful if you could isolate it in a small sample and send it us alongside all resources we may need to build and test it on our side. You may send the sample by email to support at advancedinstaller dot com.

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

ehardin
Posts: 85
Joined: Fri Jul 13, 2007 8:10 pm

Re: Licensing InitLicensingSupport readSettingsProc Error

Tue Jun 25, 2019 4:58 pm

My desktop development machine is a Win7. AI version 8.0.2 VS 2013

I had uninstalled my previous app install, compiled the AI project and reinstalled the app. When I try to run the installed app I get the "Check online..., Close the program..., Debug the problem..." box. Clicking on the "Show details" it says that the
Problem Event Name is "BEX" and the
Fault Module Name is StackHash_0a9e.

If I copy that trial.dll from the install over to my VS 2013 development area and run compile and run in debug mode I can follow the call
int ret = InitLicensingSupport(kLibraryKey, parentWnd) starting in OnInitialUpdate()

In the InitLicensingSupport() function it goes through
HMODULE hModule = ::LoadLibrary(L"Trial.dll");
without a problem. Then it goes through
TrialFcn readSettingsProc = reinterpret_cast<TrialFcn>(
::GetProcAddress(hModule, "ReadSettingsStr"));
without a problem. But then, on the line
int ret = readSettingsProc(aKeyCode, aHWnd);
it crashes with the error Unhandled exception at 0x002570B8 in <my.exe> : 0xC0000005: Access violation executing location 0x002570B8.

I took my AI install package over to a virgin Win7 lap top and installed it there. When it came time to run the app nothing happened. No errors, no blips, beeps, or messages...nothing. I tried several times and nothing.

I then took the AI install package to a Win10 laptop, uninstalled my previous installation of the app, installed this one, and first got an error message "Failed to create empty document" and then it closed. When I tried to start the app again, I got nothing like on the Win7 laptop above. I tried several times.

In the process of trying to resolve the issue I have gone into the AI -> Licensing tab and right clicked on the Trial and selected Testing -> Remove Trial Info.
In the Registration tab Identity section Library Key: I have clicked on the Generate key to produce another Library Key and I copied that new number into my app in the line #define kLibraryKey "0868AAC0B34FC565BF11671595B11A7640EC6E"
I recompiled, uninstalled my app, reinstalled, etc. etc. and always got the same results.

I will try to create a small project and see if I can duplicate the error.

Ed

ehardin
Posts: 85
Joined: Fri Jul 13, 2007 8:10 pm

Re: Licensing InitLicensingSupport readSettingsProc Error

Tue Jun 25, 2019 7:55 pm

Ok.......I created a small C++ VS 2013 project and compiled.
I now went to AI to create a new project based on this app
If I go to Licensing all it gives me is Package Serial Validation

The Help (for what it is worth) says
Advanced Licensing main characteristics:
Adding a new licensing configuration
New Trial Select the “Trial & Registration”

Yea....well of course none of that is there and the icon is greyed out.

Anybody want to tell me how to run "Advanced" Licensing on?

Ed

ehardin
Posts: 85
Joined: Fri Jul 13, 2007 8:10 pm

Re: Licensing InitLicensingSupport readSettingsProc Error

Tue Jun 25, 2019 8:56 pm

OK...Even though the Advanced Licensing Help page doesn't mention it anywhere I discovered that the Advanced Licensing is only available in Enterprise projects. My test project defaulted to Professional so I had to switch and it then showed up. As an aside, it would have been helpful to to put the title at the top of the help page as
Advanced Licensing Page (Enterprise projects only)...

Anyway, back to the original problem. I created a very small C++ VS 2013 app that produced a single exe file and then created a VS "Enterprise" project in AI.
I copied the Library Key to the C++ program and then compiled.
I then compiled the AI project and then I installed on my desktop. Same error as mentioned above.
I then copied the trial.dll from the install over to the VS 2013 development area and got the same errors in Debug and Release mode.

Error as show in VS 2013 debug mode.
First-chance exception at 0x00723420 in MonitorTest.exe: 0xC0000005: Access violation executing location 0x00723420.
Unhandled exception at 0x00723420 in MonitorTest.exe: 0xC0000005: Access violation executing location 0x00723420.
The program '[14236] MonitorTest.exe' has exited with code 0 (0x0).

What else can I tell you or show you that might help track this down?

Ed

ehardin
Posts: 85
Joined: Fri Jul 13, 2007 8:10 pm

Re: Licensing InitLicensingSupport readSettingsProc Error

Tue Jun 25, 2019 9:36 pm

PS...what is the possibility that the base Trialware.dll in the
C:\Program Files (x86)\Caphyon\Advanced Installer 8.0.2\stubs\x86a
directory is corrupted in some way?
The properties show no File Version, Product Name, or Product Version.

Ed

ehardin
Posts: 85
Joined: Fri Jul 13, 2007 8:10 pm

Re: Licensing InitLicensingSupport readSettingsProc Error

Tue Jun 25, 2019 10:18 pm

PPS.. In the Help -> How Tos -> Licensing -> Intergrating into C++ in Step 2 it says

// Optionally, you can specify a parent window for the licensing messages
HWND parentWnd = m_hWnd; // can be NULL
int ret = InitLicensingSupport(kLibraryKey, parentWnd);

Does this mean that m_hWnd may end up being NULL or that we could just pass NULL as a parameter as in
int ret = InitLicensingSupport(kLibraryKey, NULL);

If that was the case I could eliminate the parentWnd as one of the two variables.

Ed

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

Re: Licensing InitLicensingSupport readSettingsProc Error

Wed Jun 26, 2019 10:27 am

Hello Ed,

The m_hWnd parameter can be null means that you can use a call like this

Code: Select all

int ret = InitLicensingSupport(kLibraryKey, NULL);
Also I really cannot say if the trial.dll within the Advanced Installer installation folder is corrupted, but the only way we could investigate this further will be for you to isolate the issue in a small sample and sent it us by email alongside all the resources we need to build and test this.

In what regards our Advanced Licensing help page not mentioning that our trial support is available only starting with the Enterprise edition, could you forward us the link to the help page you are referring to? This is because we really strive to mention in our help docs the edition you need to use a specific application feature, for instance you can check the first note of the following articles

- Trial and Registration Page
- Integrate licensing feature in VB projects

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

ehardin
Posts: 85
Joined: Fri Jul 13, 2007 8:10 pm

Re: Licensing InitLicensingSupport readSettingsProc Error

Wed Jun 26, 2019 2:51 pm

Do you want the small test .aip file only with the single .exe file that is the program or do you also want all of the files that make up the VS 2013 program that compiles into the single .exe file?

Who do I email the simple AI project with the single .exe file to? Also, let me know if you want the VS 2013 C++ project files.

As far as the Help page, if you select the Licensing page (while in a Professional project) and click on the (?) icon you will get the "Advanced Installer User Guide" -> "Package Serial Validation Page". No where is it mentioned that this is what you will see in Professional Project mode and that there are other options in Enterprise Project Mode.

If you are in Enterprise Project Mode and select Trial & Registration you will get the "Advanced Licensing Overview" help page. No where on that page does it mention that this is only visible/available in Enterprise Mode. If you then click on the (?) icon you get the Advanced Licensing Page help page and, again, there is no mention of Enterprise Mode.

If you select Trial and click on the (?) icon you will get the Licensing Options help page.

Ed

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

Re: Licensing InitLicensingSupport readSettingsProc Error

Thu Jun 27, 2019 1:55 pm

Hello Ed,

Yes, please send us by email the VS 2013 C++ project code files too.

In what regards to the help files not mentioning the product edition each feature is available on, this happens indeed because you are running Advanced Installer 8.0.2. Indeed in old version of our product we did not mention explicitly on each feature help page the edition you needed.

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

ehardin
Posts: 85
Joined: Fri Jul 13, 2007 8:10 pm

Re: Licensing InitLicensingSupport readSettingsProc Error

Sun Jun 30, 2019 4:53 pm

Daniel,

I assume that you have received the VS 2013 source files and previously the .aip and the .exe installer files. Any word yet on what may be causing the problem?

Ed

ehardin
Posts: 85
Joined: Fri Jul 13, 2007 8:10 pm

Re: Licensing InitLicensingSupport readSettingsProc Error

Tue Jul 02, 2019 4:06 pm

Daniel,

I've sent all of the files requested but have not heard back from anyone. Are you working on the problem?

If you have decided not to try and solve the problem, let me know so that I can move on and try to figure something else out.

If you are working on the problem, let me know so that I can wait patiently for your reply.

Ed

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

Re: Licensing InitLicensingSupport readSettingsProc Error

Wed Jul 03, 2019 10:59 am

Hello Ed,

I apologize for my delayed reply.

I have further investigated your scenario and it seems the issue is caused by the charset selected for our trial.dll library. You should choose the Unicode charset for the trial library.

Just go to "Licensing" page -> "Options" tab and select the "32-bit Unicode library" option, rebuild your setup project and test it again.
Capture.JPG
Capture.JPG (138.24KiB)Viewed 7395 times
Also, since modern Windows OS versions (Windows 8, Windows 10) were not released yet when we build Advanced Installer 8.0.2, please note that we cannot offer you any guarantee that the trial.dll delivered with our old application version is fully compatible with the latest Windows operating systems. Therefore I highly recommend you to upgrade to our latest application version.

If there is anything else we can help you with just let us know.

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

ehardin
Posts: 85
Joined: Fri Jul 13, 2007 8:10 pm

Re: Licensing InitLicensingSupport readSettingsProc Error

Wed Jul 03, 2019 5:06 pm

Daniel,

Fantastic! That seems to have done the trick. I's always something.

I was worried for a minute that y'all had deserted me ;-)

Now I can move on with getting this implemented into the actual app.

Thanks again.

Ed

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

Re: Licensing InitLicensingSupport readSettingsProc Error

Thu Jul 04, 2019 8:29 am

You are always welcome Ed.

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

Return to “Common Problems”