Securing xfNetLink applications with License Manager

Follow these steps to secure an xfNetLink .NET application with License Manager. (Syncli_api.dll is not currently supported on xfNetLink Java.) These instructions presume you are using xfNetLink, but the functions in syncli_api.dll can be called from a C, C++, .NET, or any other application that can call a DLL.

1. Install the License Key Generator utility on a Windows machine and then install the configuration key you received from Synergex.
2. Install xfNetLink .NET, which includes syncli_api.dll. This DLL contains the functions you will call from your client application to implement licensing.
3. Create an application code for each application you want to secure with License Manager.

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

4. Include a call to the win_lm_login function at the beginning of the application you want to secure.

The win_lm_login function calls License Manager and returns a status value.

5. Include a call to the win_lm_login function at all exit points in your application.

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

6. Write a subroutine to handle your security, including any forced exit resulting from security failure. Although win_lm_login and win_lm_logout return status values, these values do not affect your application. Your security subroutine must include code to handle the returned status.
7. Provide a way to log out all licenses in case of untrapped errors or when the user exits by clicking the Close button (the X in the upper right corner of an application window). You can add an application‑level try‑catch‑finally statement and use win_lm_logout to ensure that the license is logged out or use the win_lm_cleanup routine to log out all licenses in use by a process.
8. (Recommended) Add code to log errors to the Windows event log.


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

1. Set up a Synergy license server on a Windows machine at the customer site.
2. Install xfNetLink .NET and your application on the client machine. This can be the same machine as the license server or it may be a different machine.
3. On the xfNetLink machine, run lmu.exe (included in the xfNetLink .NET distribution) to initialize License Manager as a license client to your license server machine:
lmu -cserver_name -nc
4. Run lmu ‑b on the license server machine to get the registration string.
5. Use the licensee name and registration string to generate configuration keys. See Generating configuration keys.
6. Install the keys on the customer’s license server machine. This configures License Manager to run your application.