GeoMedia Discussions

Search for an answer, post a question, or answer other users' questions in our GeoMedia support discussions. This discussion board is a great way to collaborate with industry peers around the world. It is intended for discussion and support of the GeoMedia Desktop and Add-on applications.
Showing results for 
Search instead for 
Do you mean 
Reply
Contributor
Posts: 30
Registered: ‎11-02-2017
Accepted Solution

How to check for a valid license using GeoMedia Objects

Hello,

 

I would like to find the best way to check programatically if a GeoMedia license is installed, using GeoMedia objects.

 

What is the best way to do this?

 

Many thanks

 

Adrian

Technical Evangelist
Posts: 535
Registered: ‎09-11-2015

Re: How to check for a valid license using GeoMedia Objects

Hi Adrian,

 

I was dealing with this problem some time ago and could not find any acceptable solution. I don't think it is possible using GM Objects. Perhaps the only way is to create GMMapView object (btw. this is probably the only one checking for the license) in a try ... catch block and check the possible exception. But this is not very convenient.

 

Pavel

Contributor
Posts: 30
Registered: ‎11-02-2017

Re: How to check for a valid license using GeoMedia Objects

Thank you Pavel! That is exactly what we currently have setup and it is working well but I thought there might have been a better solution.

Frequent Contributor
Posts: 124
Registered: ‎11-10-2015

Re: How to check for a valid license using GeoMedia Objects

Hi all,

 

I had a similar problem, it was to get the hostID of a machine without installing the Licensing Administrator on the client machine

 

I have wrtitten a code making the following actions :

  • Create a licerr.txt file in the c:\temp directory
  • Run GM
  • Kill the GeoMedia.exe process after 30s
  • Open the licerr.txt file to get the line where the hostID is indicated
  • Delete the licerr.txt file

In your case, you can use the same method, but just check if the licerr.txt is empty or not. If empty -> license valid, if not empty -> license invalid

 

Regards

Benoît

Contributor
Posts: 30
Registered: ‎11-02-2017

Re: How to check for a valid license using GeoMedia Objects

Thank you for the suggestion Benoît. That is a clever solution!

 

For now we have put a try/catch statement around the piece of code that creates the Map View which is a good indication that the license is not present.

 

Many thanks

 

Adrian