This applies to the legacy SLP Runtime only. For guidance on using the newer SpAgent runtime please see Getting Started With Licensing.
This Quick Start Guide for new users will get you up and running with the Software Potential licensing solution 7 easy steps.
- Step 1: Setup Your Development Environment
- Step 2: Define Product / Features
- Step 3: Configure Licensing
- Step 4: Enable Licensing
- Step 5: Select Methods to License and Protect
- Step 6: Build Your Application
- Step 7: Issue License
Step 1: Setup Your Development Environment
Setting up your Development Environment is straight forward; however it is best done by a software developer.
1. Create your Permutation
To get started, you need to generate a unique permutation for your product. A permutation file contains a unique one-way transformation which, when loaded into the Code Protector, transforms the CIL of your assembly so that the protected assembly cannot be reversed engineered.
- Logon to the portal https://srv.softwarepotential.com.
- Select Accounts → Manage Permutations → Create Permutation.
- Enter a name for your permutation and click OK.
- Eventually (click refresh) the status field will change from Creation Pending to Done.
2. Download Code Protector and Permutation
Before they can be installed on your development/build machine, the permutation and the code protector tool need to be saved locally to your machine, where they are easy to find later.
- Select Develop → Manage Permutations and select your permutation by clicking on the record in the table.
- Download the Code Protector .msi file and Permutation file using the links in the respective Downloads column and save them locally.
You must ensure you download both the Code Protector and Permutation file as their versions must match for the next step.
3. Install Code Protector and Permutation
Locate Code Protector on your development machine and double click the .msi to install. Once installed:
- Launch Code Protector.
- Select Permutations tab and the click the Install Permutation button.
- Locate the previously saved Permutation file and click OK.
Now that your Development Environment is set up the next step is to create a Product and, if required, Features and Feature Sets, in the Software Potential service.
Step 2: Define Product/Features
With your Development Environment set up, you need to define a Product and, optionally, Features, Feature Sets and SKUs, in the Software Potential service.
This step can be done by the developer or a product manager / commercial manager.
1. Create Product
The first task is to define your product to be licensed in the licensing system:
- Select Define → Create Product in the main navigation bar and define the product in terms of Name, Version Number and Description, then click OK.
2. Define Features
You now optionally define one or more features to be licensed for the product you have created. (You can have as few as zero features - in this case the product is licensed as a whole).
To define a Feature for a product:
- Select Define → Manage Products
- Select the new Product-Version from the list of products displayed and click Edit.
- Enter a feature Name and an optional Description and click + to save feature. Repeat as required until all features have been defined.
3. Define Feature Sets
You now optionally group related features into Feature Sets to simplify the addition of multiple features to a license when issuing licenses later. define one or more features to be licensed for the product you have created.
To define a Feature Set for a product:
- Select Define → Manage Products
- Select the new Product-Version from the list of products displayed and click Edit.
- In the Features panel enter a Feature Set Name and click + to save the feature set.
- In the Available Features panel select one or more features to add to the Feature Set and click the Add Selected button.
- Click Save to save the updated Feature Set definition.
4. Create SKUs
You can now optionally define one or more Stock Keeping Units (SKUs) for your product (licensed editions of your software e.g. Trial, Standard, Professional).
A SKU serves as a template from which one can subsequently generate licenses. For more information on SKUs and the parameters you can set for a SKU, check the Getting Started Guide.
To create a SKU for a product:
- Click on Define → Create SKU
- Define your SKU according to your business requirements and click Save button.
The SKU should now be listed in available SKUs from which licenses can be generated. To view these SKUs select Define → Manage SKUs.
You are now ready to implement the licensing checks in your application's assemblies.
Step 3: Configure Licensing
This step enables both protection and licensing of your application in your MSBuild environment:
1. Configure Code Protector
To enable automation of the code protection step within your build environment, you first need to store the Code Protector settings in a SLMCfg configuration file that will be used by Code Protector when protecting your code.
- Launch Code Protector and login using your Software Potential account credentials.
- Select Project tab and in the right hand Settings panel set the following values:
- Permutation: previously installed permutation.
- Target SLP Runtime Variant: Set this to the same value as you set in the Visual Studio project i.e. either Standard or Distributor.
- Product Name: <ProductName> which is the name of the product you are licensing.
- Select Add Modules to add one or more application assemblies to be protected. The selected assemblies will appear in the tree view.
- Select File → Save As and save the Code Protector configuration as <ProjectName>.SLMCfg file alongside your project file in your project directory
(where ProjectName is the name of the project containing code to be protected and/or licensed).
2. Configure Protection in Build Process
In Visual Studio open your project’s Properties, select Build and add the conditional compilation (i.e., #define) symbol SLPS_PROTECT for the active build configuration. When this is set, the assemblies created by the build process will be both protected and licensed automatically using the settings in the SLMCfg file created earlier.
For SLPS_PROTECT to be detected correctly all symbols must be delimited by semi-colons - the Visual Studio project system also accepts spaces and commas.
3. Reference Permutation Runtime Files
Add references to the Permutation Runtime Files by editing your Visual Studio project (csproj/vbproj) file to add the following entries.
<PropertyGroup>
<SlpsRuntimeVariant>{Variant}</SlpsRuntimeVariant>
<SlpsRuntimePermutationId>{Permutation ID}</SlpsRuntimePermutationId>
</PropertyGroup>
<Import Project="$(MSBuildProgramFiles32)\InishTech SLP Code Protector\Slps.Runtime.References.targets" />
where
• {Variant} is either Standard or Distributor,
• {Permutation ID} is the filename of the permutation installed in Code Protector earlier>Your project is now set up to trigger code protection automatically during the build process using the settings in the SLMCfg file.
Step 4: License Enable Your Application
To enable licensing of your application you will need to:
1. Configure License Storage
Your applicatoin installation process needs to configure the runtime components with license stores etc. To do this:
- Add a custom installer class to your application (see Annex for snippet) and invoke this from your installer.
- Add a validation check to your application to ensure stores are correctly configured (this must be run before any protected code is run).
[See Support KB7 and Support KB14 for further details- including code snippets- on installation of runtime components.]
2. Customise Activation Mechanism
The SLP Runtime provides a default Activation Wizard that supports both Online and Manual (offline) activation modes. This is displayed automatically when the runtime detects a situation where a license is not available to run license code.
You can change how and where this Activation Wizard is displayed via your application code - see Activation UI for more details.
Step 5: Select Methods to Protect and License
You will need to map methods in your assemblies against Features that you defined in your Product Definition in Software Potential Service. In your application source code, mark each method to be protected and licensed with the appropriate attributes as follows:
- Protection Only: mark the method with the protection attribute [Protection].
- Require a License To Run: mark the method with [Feature].
- Require a specific Feature to Run: mark the method with [Feature(“Feature Name”)] .
where Feature Name is the name (as defined in the Software Potential service) of the Feature to be associated with the selected method.
To use the ProtectionAttributes in a source file you will need to add “using Slps.ProtectionAttributes;” to the start of the file. See Declaratively Mark Methods for further details on how to declaratively select methods for protection and/or licensing.
Step 6: Build the application
Now build your application as usual. On successful protection the assemblies in the relevant project output directory (e.g. bin/Release, bin/Debug as appropriate) are now protected with the required license checks implemented.
Your application assemblies are now protected and licensed, and once packaged, your application is ready for distribution to your customers. The next step is to create / issue licenses for the customers to activate your software once installed.
Step 7: Issue Licenses
To issue licenses you will need to first login to the portal https://srv.softwarepotential.com and then either
- Create Custom License
- Create License From SKU
Each license issued has an associated Activation Key which the customer must use to activate the license on a device.
When an attempt is made to run the licensed application on a device without a license, the runtime's Activation Wizard will by default prompt the user to enter an activation key to activate the corresponding license.
On successful activation the license file is downloaded and installed in the locally configured license store, and the application can be executed in conformance with the terms of the installed license(s).
Comments
0 comments
Article is closed for comments.