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 product key for it using the Synergy key file you received from Synergex or by syncing with the Synergy License Web Service.
2. Create an application (product) code, with a maximum of six alphanumeric characters, for each application or application component 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 product keys.

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 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 code 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.
Tip

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.

Deployment

This section describes what to do when you are ready to deploy your secured Synergy application at a customer site.

1. Install Synergy/DE at the customer site on the machine that will be used as the license server.
2. Run lmu -b on the license server machine to get the registration string.
3. Use the registration string and the licensee name to generate product keys for the application code you created in step 2 above. See Generating product keys with lmk and lmkx (Windows).
4. Install the product keys on the License Manager machine using the Synergy Configuration Program or lmu. (See Licensing Synergy/DE products on a system without internet access.)
5. Install your Synergy application.