Securing Synergy applications with License Manager

Follow these steps to secure a Synergy application with License Manager.

1. Install the License Key Generator utility on a Windows machine and then install the configuration key you received from Synergex.
2. Create an application code for each application you want to secure with License Manager.

The application code is passed when you make calls to LM_LOGIN and LM_LOGOUT. It is also used when you generate configuration keys. The application code can have a maximum of six alphanumeric characters.

3. Include a call to the LM_LOGIN subroutine at the beginning of the application you want to secure.

LM_LOGIN calls License Manager and returns a status value and configuration information about the log‑in.

4. Include a call to the LM_LOGOUT subroutine at all exit points in your application.

LM_LOGOUT frees the current user process from the tally of concurrent log‑ins for the application and returns a status.

5. Write a subroutine to handle your security, including any forced exit resulting from a security failure. Although LM_LOGIN and LM_LOGOUT return status values, these values do not affect your application. Your security subroutine must include code to handle the returned status.

You can use the .NODEBUG compiler directive to prevent debugging of this subroutine. The .NODEBUG directive deactivates debugging for modules that you don’t want anyone to look at. You can place it anywhere in your subroutine.

6. (Recommended) Add an application‑level TRY‑CATCH‑FINALLY statement to your main application module to ensure that the license is logged out if an untrapped error occurs.
7. (Recommended for Windows) Add code to log errors to the Windows event log.
8. After your application is installed at a customer site, request that the customer send you the licensee name and registration string.
9. Generate configuration keys for your customers, using the licensee names and registration strings they send you. See Generating configuration keys.
10. Send the configuration keys to your customers so that they can configure License Manager to run your applications.