Any questions? Ask us:

Plugin: Multiple instances & One registration dialog

Questions, downloads, issues related to plugins for Enigma Protector

Plugin: Multiple instances & One registration dialog

Postby Enigma » Mon Mar 12, 2018 1:38 pm

Next example of flexibility of our Enigma Protector with the plugins system!

We recently got a request from user to fit the following licensing scheme: there are multiple instances of protected application are being running, but only one copy should show a registration dialog, others should wait that.

If we try to apply the standard registration dialog feature to this complex scheme, we find that each running copy will show a registration dialog. This is what client would like to avoid.

We decided to develop a small plugin that will create an event object and while the first running copy shows the registration dialog, others will wait until it completes.

Sources of the project for Delphi and Lazarus are in attachment. Binary is also included.

The magic happes there:
Code: Select all
procedure Enigma_Plugin_OnInit;
  errorcode : dword;
  hndl : THandle;
  // This function is calling when the protected file is being initialized
  // when main program is not initialized yet
  if EP_RegLoadAndCheckKey then

  hndl := CreateEvent(nil, true, false, 'ihiyGUgKUgukiU78yoihilh7ilgUgkuhGKJgI');
  if hndl <> 0 then
    errorcode := GetLastError;
    if errorcode = ERROR_ALREADY_EXISTS then
      WaitForSingleObject(hndl, INFINITE);
    end else
  if not EP_RegLoadAndCheckKey then

- first we check if application is already registered with EP_RegLoadAndCheckKey. If it is - continue execution
- then we create an event object
- if the event object is new one, we show a registration dialog
- if event object already exists, we run the wait routine WaitForSingleObjectthat, it waits the event to be signalled
- once first isntance finished with the registration dialog (user entered the license info or just closed it) it signals SetEvent to other processes to continue
- finally, everyone checks again if application is registered and calls ExitProcess on fail.
You do not have the required permissions to view the files attached to this post.
Site Admin
Posts: 2348
Joined: Wed Aug 20, 2008 2:24 pm

Re: Plugin: Multiple instances & One registration dialog

Postby syntax101 » Mon Apr 16, 2018 1:14 pm

This plugin is not working as it should, please refer to email for clarification about this plugins..

Posts: 4
Joined: Thu Feb 15, 2018 12:39 am

Re: Plugin: Multiple instances & One registration dialog

Postby syntax101 » Sun Apr 22, 2018 11:49 pm

Any update for this plugin sir??
Posts: 4
Joined: Thu Feb 15, 2018 12:39 am

Return to Plugins

Who is online

Users browsing this forum: No registered users and 7 guests