Generating product keys with lmk and lmkx (Windows)

Once License Manager has been installed at a customer site, you will need the registration string and licensee name from the machine it was installed on. You must then generate product keys and install them to allow License Manager to run your application. Generating product keys can be done only on Windows.

There are two ways to generate product keys:

This topic includes the following sections:

License Key Generator (lmk) utility

The License Key Generator utility, lmk, is used to generate product keys. As with other Synergy/DE products, it must be licensed before it can be run.

Note

REV11 keys (for systems running Synergy/DE version 11 and higher or the REV11 licensing upgrade package) must be generated to a Synergy key file (.skf file); this .skf file must contain the complete set of keys for your producer code for the system. Pre-REV11 keys may be generated to a .skf file or individually to the screen. A .skf file can contain keys of only one format (either REV11 or pre-REV11)—not both.

To generate keys to a .skf file, use this syntax:

lmk -cname -fcfilename 
lmk -aapp_code -cname [-d[+]days] -fafilename -rstring -uusers [-xstring]

To generate keys to the screen, use this syntax (pre-REV11 only):

lmk -aapp_code -cname [-d[+]days] -rstring -uusers [-xstring]

-aapp_code

The application code that you created to represent the application, with a maximum of six alphanumeric characters. To have a description of the application code appear in the .skf file, see Using a prods.lmk file, below.

-cname

The licensee name (obtained from the customer site).

-ddays

The number of days since January 1, 1992 that you want the keys to be valid. If you don’t want the product to time out, either omit this option or set days to 0 (zero).

-d+days

The number of days from the current date that you want the keys to be valid. For example, if today is March 3, and you want the product to time out on March 15, you’d use -d+12. If you want the license to be good for a year, use -d+365. If you don’t want the product to time out, omit this option. Setting it to 0 (zero) makes the license time out at the end of the day.

-fafilename

Append to an existing Synergy key file named filename. The .skf extension will be added if not specified.

-fcfilename

Create or overwrite a Synergy key file named filename for a specified licensee. The file is created in the current directory, unless you specify a complete path or a logical. The .skf extension will be added if not specified. Use with -c.

-h

Display a list of lmk options.

-rstring

The registration string (obtained from the customer site). The string may be specified with or without dashes.

-uusers

The maximum number of users for app_code. The maximum is 32,767.

-v

Display the version number of lmk.

-xstring

A developer-defined data string, which can contain up to 100 characters.

Arguments that include spaces must be enclosed in quotation marks. For example, if you want to specify the licensee name ABC Consulting Corporation with the -c option, you’d enter it as

-c"ABC Consulting Corporation"

The -d and -d+ options offer two methods of creating a license that expires after a specified number of days (e.g., a demo license). For a utility that calculates the number of days between a given date and January 1, 1992, see LmkEvalDate.zip, available from Synergy CodeExchange in the Resource Center on the Synergex website. You can also create a license that times out by using the lmkx utility, which allows you to enter either a specific date or a number of days. See lmkx utility.

The -x option enables you to include your own string for anything that you want to check regarding the product that is being licensed. For example, you could use this string to check the version number of your application. (Of course, you will have to include code in your application to handle the information included in the string.)

Generating a Synergy key file

REV11 product keys must be generated to a Synergy key file. For pre-REV11 product keys, we recommend creating a key file because it enables users to easily license your products without having to type the product key, but you may generate keys individually to the screen instead; see Generating pre-REV11 keys to the screen.

Tip

If you’re not certain whether the keys you are generating are for a REV11 or pre-REV11 machine, you can tell by the length of the registration string. For REV11, it is 31 characters (without hyphens) versus 12 characters for pre-REV11.

Important

When generating a REV11 key file with lmk or lmkx, you should generate all keys for the file on the same day. If you generate some keys on one day, and then try to add more keys at a later date, you will get a “Cannot add keys to old skf file” error. You must then re-create the .skf and add all the keys. This happens because there is an identifier in the file header that is tied to the date the file was created.

The procedure below creates a key file and then generates keys and puts them in the file.

1. First, create the key file with the -c and -fc options. For example,
lmk -cMickey -fcKEYS:Mickey

creates a file named Mickey.skf for licensee Mickey and places it in the directory specified by the KEYS logical. The file header will include the licensee name and the creation date. (You don’t have to name the key file with the licensee name, but it can be convenient to do so.)

2. Once the file is created, run lmk for each application code, and specify the key file with the -fa option. This will generate the keys and add them to the existing file. For example, to generate 10-user licenses for the application codes CON5 and MAR5 and add them to the Mickey.skf file, you would use the following:
lmk -aCON5 -cMickey -rS6HSSFY-CWGD5MK-QVUUAAQ-S3ADLRA-PIU -u10 -faKEYS:Mickey
lmk -aMAR5 -cMickey -rS6HSSFY-CWGD5MK-QVUUAAQ-S3ADLRA-PIU -u10 -faKEYS:Mickey
Note

When you are generating REV11 keys, the .skf file may contain keys for only one system (that is, a single registration string). For pre-REV11 keys, you can create a .skf file that contains keys for more than one system.

Using a prods.lmk file

You can use a prods.lmk file to specify descriptions for your application codes. When you generate keys to a .skf file, you’ll see a line with “Name=application description” for each key. You’ll also see this description when you run lmu to view information for a specific application code.

A sample prods.lmk file is included in the Licensing Toolkit distribution. Edit the file to include each of your application codes, followed by one or more spaces, and then a description. (See the examples in the sample file.) Make sure the file is named prods.lmk and place it in your DBLDIR or DBLDIR\bin directory. This file will be read when you generate keys to a .skf file with lmk or lmkx.

Generating pre-REV11 keys to the screen

(pre-REV11 only) To generate a product key to the screen, specify the application code, licensee, registration string, and number of users. The example below generates a 10-user license for licensee Mickey and application code CON5:

lmk -aCON5 -cMickey -r2580RCK7QG88 -u10 

The product key displays to the screen.

lmkx utility

The lmkx.dbr utility (included in your Licensing Toolkit distribution) provides a user interface to the License Key Generator utility (lmk). We explain below how to use lmkx as distributed, but you can customize it if desired; the source files are included in your Licensing Toolkit distribution. (Lmkx is a UI Toolkit program, so you will need to have Toolkit installed to build it.)

Lmkx creates a Synergy key file named with the licensee name and places it in the current working directory.

1. Run lmkx from the command line:
dbr lmkx 
2. Complete the fields:

Licensee name

Enter the customer’s licensee name.

Registration string

Enter the registration string obtained from the customer site. Include the dashes.

Application code

Enter the application code for this product. See Using a prods.lmk file above for instructions on how to include a description of the application code in the .skf file.

Number of users

Enter the number of concurrent users permitted. The maximum is 32,767.

Timeout

(optional) Enter the date you want this license to expire in MM/DD/YYYY format, or press F3 and enter the number of days from the current date that you want the license to be valid. Leave this field blank for a license that does not expire.

Extended data

(optional) Enter a developer-defined data string. This string may contain up to 100 characters. You can use this option to include your own string for anything that you want to check regarding the product that is being licensed. For example, you could use this string to check the version number of the application.

3. Press Enter. The lmkx utility creates the .skf file, generates the product key, and adds it to the file. If the addition is successful, you’ll see a message to that effect below the Extended data field.
4. Continue entering application data to add more product keys to the .skf file. After you add three product keys, pressing Enter takes you back to the first set of fields and you can continue adding keys.
5. When you are finished adding keys, press F4 to exit.

lmk and lmkx errors

These are some of the errors that may occur when you are using lmk or lmkx to generate product keys.

lmk Error Messages

Message

Cause

Cannot add keys to old skf file; file must be re-created The Synergy key file was originally generated on an earlier date, and now you are trying to add more products to it. You must start over and add all the products at the same time.
Concatenation of product keys not allowed You are trying to add REV11 keys to a Synergy key file that already contains pre-REV11 keys or vice versa. Or, you are creating a key file with REV11 keys and tried to put keys for more than one registration string in the same file; for REV11, a .skf file may contain keys for only one system.
LMK is not licensed You must install the product key for lmk by syncing with the Synergy License Web Service (lmu -sync) or using the Synergy key file sent to you by Synergex.
REV11 keys must be generated to a skf file (-fa option required) You cannot output REV11 keys to the screen; they must be generated to a Synergy key file, specified with the -fa option. See Generating a Synergy key file. (Pre-REV11 keys can be output to the screen.)