WebExeBuilder Documentation

License Key Generator

The License Key Generator is a built-in tool for creating, verifying, and distributing license keys to your customers. It opens when you click the Generate Key button in the Security tab of App Options.

The generator reads your project's package configuration, so the packages, expiry settings, and license types you've set up are all available here automatically.


Opening the Generator

  1. Open your project in the Builder
  2. Go to App Options → Security
  3. Make sure Restricted Mode is enabled and License Provider is set to Built-in
  4. Click the Generate Key button

The generator window opens with four tabs: Generate License, Verify License, Email Template, and Email to Send.


Generate License Tab

This is where you create license keys for your customers.

Fields

  • User Name — the customer's name. This gets baked into the key, so the customer must enter it exactly as shown when they register. Case matters.
  • System ID (User Generated) — leave this empty for a floating key (works on any machine), or paste a customer's System ID to create a hardware-locked key. Click the System ID button to generate the current machine's ID for testing.
  • Package — dropdown of all packages in your project (except Default Package). Selecting a package auto-fills the Package Key and expiry settings.
  • Package Key — shown as a label below the Package dropdown. This is the internal key that ties the license to a specific package tier.
  • License Type — the type embedded in the key. Options: Free, Trial, Student, Personal, Individual, Business, Paid, Subscription, Donation, VIP, Perpetual, Lifetime.
  • Expiry Days — auto-filled from the package's expiry configuration. If the package has expiry enabled, this field is read-only and shows the configured value. If the package doesn't expire, it shows 0.
  • PC System ID — label in the top-right corner for reference.

Expiry Behavior

The expiry configuration comes directly from your package settings:

  • If the package has Expire enabled with Days type, the field shows the number of days and is locked
  • If the package has Expire enabled with Runs type, the field shows the number of runs and is locked
  • If the package has Expire disabled, the field shows 0 (never expires) and is locked
  • Lifetime, Perpetual, and Free license types never expire regardless of package settings

Generating a Key

  1. Enter the customer's name in User Name
  2. Select the appropriate Package from the dropdown
  3. Choose the License Type
  4. Optionally paste the customer's System ID for hardware locking (leave empty for floating)
  5. Click Generate License Key

The generated key appears in the Generated License box at the bottom, along with a summary showing:

  • Whether it's a floating or hardware-locked key
  • User name, package, license type
  • Hardware lock status
  • Expiry date or "Never"
  • Certificate ID (unique per key)

The key is also automatically copied to the Verify tab for quick testing.

Key Format

Keys follow the format XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX — 8 groups of 5 characters separated by hyphens. Only uppercase letters (A-Z), digits (0-9), and hyphens are used.

Floating vs Hardware-Locked Keys

  • Floating key — leave the System ID field empty. The key works on any machine. This is the default.
  • Hardware-locked key — paste the customer's System ID into the field. The key only works on that specific machine. The customer can find their System ID in the registration dialog of your app (if Show System ID is enabled in your project settings).

Verify License Tab

Use this tab to test and validate license keys.

Fields

  • License Key — paste or type the key to verify
  • User Name — the name the key was generated for

Verifying a Key

  1. Paste the license key into the License Key field
  2. Enter the user name in the User Name field
  3. Click Verify License

The Verification Result box shows:

  • Whether the key is valid or invalid
  • If valid: user name, package, license type, expiry date, days remaining, and certificate ID
  • If the key has expired, a warning is shown
  • If invalid: the specific error (wrong length, wrong machine, tampered, etc.)

When you generate a key on the Generate tab, it's automatically copied here so you can verify it immediately.


Email Template Tab

This tab lets you create and customize the email you send to customers with their license key.

Template Modes

The template operates in two modes:

  • Virtual (Read-only) — the default. Shows the built-in template but can't be edited. The label at the bottom reads "Template Mode: Virtual (Read-only)" in maroon.
  • File-based (Editable) — after you click Create Project Template, the template is saved as a file in your project folder and becomes fully editable. The label reads "Template Mode: File-based (Editable)" in green.

Creating a Project Template

Click Create Project Template to save the template as YourAppName_Email.txt in your project folder. Once created:

  • The template becomes editable
  • Changes are saved automatically as you type
  • The file persists between sessions
  • You can edit it in any text editor outside the Builder too

Template Tokens

Templates use {{token_name}} placeholders that get replaced with actual values when a key is generated. Available tokens:

Token Description
{{user_name}} License holder name
{{license_key}} Generated license key
{{license_type}} License type (Free, Trial, Business, etc.)
{{package_name}} Package name
{{expiry_date}} Expiration date (formatted)
{{expiry_days}} Days until expiration
{{certificate_id}} Unique certificate ID
{{system_id}} Hardware lock status
{{company_name}} Company name (from About settings)
{{product_name}} Product name (from App Title)
{{support_email}} Support email (from About settings)
{{website_url}} Company website (from About settings)
{{current_date}} Current date
{{#IF_HARDWARE_LOCKED}}...{{/IF_HARDWARE_LOCKED}} Show content only if hardware-locked
{{#IF_NEVER_EXPIRES}}...{{/IF_NEVER_EXPIRES}} Show content only if license never expires

Inserting Tokens

Two ways to insert tokens:

  1. Token dropdown + Insert button — select a token from the dropdown at the top and click Insert Token. The token is inserted at the cursor position.
  2. Right-click menu — right-click in the template editor to see a popup menu with all available tokens. Click one to insert it at the cursor.

Token insertion only works when the template is in file-based (editable) mode.

Auto-Populated Values

The template engine automatically pulls values from your project settings:

  • Company name — from the About tab's Company field
  • Product name — from the Application tab's App Title
  • Support email — from the About tab's Email field
  • Website URL — from the About tab's Website field

If these fields are empty in your project, placeholder text is used instead.


Email to Send Tab

This tab shows the final, parsed email with all tokens replaced by actual values. After generating a license key, switch to this tab to see the ready-to-send email.

  • The email is read-only (it's generated from the template)
  • Click Copy Email to Clipboard to copy the full email text
  • Paste it into your email client and send it to the customer

The email updates automatically whenever you generate a new key or edit the template.


Workflow Example

Here's a typical workflow for issuing a license to a customer:

  1. Customer purchases your software
  2. Open the License Key Generator
  3. Enter the customer's name
  4. Select the package they purchased
  5. Choose the appropriate license type
  6. If hardware-locked, ask the customer for their System ID and paste it in
  7. Click Generate License Key
  8. Switch to the Email to Send tab
  9. Click Copy Email to Clipboard
  10. Paste into your email client and send

Exporting Key Generator Configuration

In the Security tab of App Options, there's an Export Key Config button (visible only when using the Built-in license provider). This exports a JSON file containing everything needed to generate license keys outside the Builder.

What Gets Exported

The exported YourApp_KeyConfig.json file contains:

  • Project info (app title, company, website, email, version)
  • All packages with their names, package keys, expiry settings, and order URLs
  • Pre-computed dynamic salts for each package (derived from the package key)
  • Available license types
  • Export date and version

Example Output

{
  "project": {
    "name": "MyApp.web",
    "appTitle": "My Application",
    "company": "My Company",
    "website": "https://myapp.com",
    "email": "support@myapp.com",
    "version": "1.0.0"
  },
  "packages": [
    {
      "pkgName": "Professional",
      "pkgKey": "A1B2C3D4E5F6",
      "expire": true,
      "exDays": 365,
      "exType": 0,
      "orderUrl": "https://myapp.com/buy",
      "expireMsg": "Your license has expired."
    }
  ],
  "secrets": {
    "packageSalts": [
      {
        "pkgName": "Professional",
        "pkgKey": "A1B2C3D4E5F6",
        "dynamicSalt": "a1b2c3d4e5f6..."
      }
    ]
  },
  "licenseTypes": ["Free", "Trial", "Student", "..."],
  "exportDate": "2026-02-10T14:30:00Z",
  "exportVersion": "1.0"
}

Security Warning

The export file contains your secret package encryption keys. A warning dialog appears before export. Keep this file secure and only share it with trusted key generation systems.

How It Relates to the CLI

The CLI currently reads directly from the .web project file (via --project), so it doesn't need this exported JSON. However, the exported config is useful if you want to build your own external key generation tools (web apps, APIs, etc.) that need the package keys and salts without access to the full project file.


Tips

  • Test your keys — always verify a generated key on the Verify tab before sending it to a customer
  • Name matching is exact — if you generate a key for "John Doe", the customer must enter "John Doe" exactly (not "john doe" or "John Doe")
  • Floating keys are simpler — unless you need hardware locking, floating keys are easier for both you and your customers
  • Set up your About info first — the email template pulls company name, email, and website from your project's About tab. Fill those in before generating keys so the emails look professional
  • Create the project template early — click "Create Project Template" once so you can customize the email format to match your brand
  • Each key is unique — even with the same user name and package, each generated key has a unique certificate ID
  • Package expiry is enforced — the generator respects your package's expiry configuration. You can't override it from the generator

Next Steps


Command-Line Interface (CLI)

A standalone CLI version of the License Key Generator is also available at src/LicenseKeyCLI/LicenseKeyCLI.exe. It supports all the same features as the GUI — generating keys, verifying keys, generating email from templates, and retrieving System IDs — but from the command line. This is useful for scripting, batch key generation, or integrating into your own tools.

Basic Usage

REM Generate a floating license key
LicenseKeyCLI.exe --project MyApp.web --package "Pro" --username "John Doe"

REM Generate a hardware-locked license key
LicenseKeyCLI.exe --project MyApp.web --package "Pro" --username "John Doe" ^
                   --systemid "ABC123..."

REM Generate with custom license type and expiry
LicenseKeyCLI.exe --project MyApp.web --package "Pro" --username "John Doe" ^
                   --type Trial --days 30

REM Generate and save key + email to files
LicenseKeyCLI.exe --project MyApp.web --package "Pro" --username "John Doe" ^
                   --output license.txt --email email.txt

REM Verify a license key
LicenseKeyCLI.exe --project MyApp.web --package "Pro" --username "John Doe" ^
                   --verify --key "XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX-XXXXX"

REM Get current machine's System ID
LicenseKeyCLI.exe --getsystemid

Parameters

Parameter Description
--project <file> Path to .web project file (required for generate/verify)
--package <name> Package name or key from project (required for generate/verify)
--username <name> License holder name (required for generate/verify)
--type <type> License type: Free, Trial, Student, Personal, Individual, Business, Paid, Subscription, Donation, VIP, Perpetual, Lifetime (default: Paid)
--days <number> Expiry days from today. Uses package default if omitted. 0 = no expiration
--systemid <id> Hardware lock to specific System ID. Omit for floating key
--output <file> Save license key and details to a file
--email <file> Generate parsed email using the project's email template and save to file
--verify Verify a license key instead of generating
--key <key> License key to verify (used with --verify)
--getsystemid Generate and display current machine's System ID
--help Show help message

Exit Codes

Code Meaning
0 Success
1 Error (invalid parameters, project not found, invalid key, etc.)
2 Key is valid but expired

Email Template

The --email flag uses the same template system as the GUI. If a project-specific template file exists (YourAppName_Email.txt in the project folder), it uses that. Otherwise, it falls back to the built-in default template. All {{token}} placeholders are replaced with actual values from the generated key.