Securing xfNetLink applications with License Manager
Follow these steps to secure an xfNetLink .NET application with License Manager. (Syncli_api.dll is not 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 product key for it using the Synergy key file you received from Synergex or by syncing with the Synergy License Web Service. |
|
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 (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 win_lm_login and win_lm_logout. It is also used when you generate product keys.
|
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_logout 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 code and returns a status.
|
6.
|
Write a subroutine to handle your security, including any forced exit resulting from a 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. |
Deployment
This section describes what to do when you are ready to deploy your secured xfNetLink .NET application at a customer site.
|
1.
|
Install Synergy/DE on the Windows machine that will be used as the license server 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. |
|
6.
|
Install the product keys on the License Manager machine using the Synergy Configuration Program or lmu. |