bright, fresh software
Downloads  |  Buy

Licensing multiple products per process

This article will teach you how to license multiple products (or plugins) within a single process. This article presumes you've already read the "Getting started with LimeLM" article and you've already added TurboActivate to your app.

By default when you use TurboActivate in your application you can only use activation for one product in that process. For the vast majority of our customers that's all you'd ever need. But what if you have plugins for your app that are sold separately (and activated separately) but run within the same process as your app?

How to do it

You can load multiple "product detail files" (a.k.a. TurboActivate.dat files) from separate products by using the PDetsFromPath() function. Then to switch between the products in TurboActivate use the SetCurrentProduct(string versionGUID) function.

Here's a simple C# example where there's a main application and a plugin:

TurboActivate.VersionGUID = "MAIN-APP-VERSION-GUID";

// Load the TurboActivate.dat file for your main application

// Check if the main app is activated
bool isMainAppActivated = TurboActivate.IsActivated();

// Load the file for Plugin1

// We have to set the current product to the plugin Version GUID
// before we can use any of the TurboActivate functions for this plugin.

// Also note we're not setting TurboActivate.VersionGUID -- this is because
// TurboActivate.SetCurrentProduct() does this for us.

// Check if the plugin is activated
bool isPlugin1Activated = TurboActivate.IsActivated();

// Now let's say you want to read a feature value for
// your main application. You have to switch back to
// the main app before you can check the feature value:
string update_expires = TurboActivate.GetFeatureValue("update_expires");

In this example we check if the main app is activated, then we check if the plugin is activated. Then we switch back to the main app to read a feature value.