From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Developer Center Resources

cancel
Showing results for 
Search instead for 
Did you mean: 

Tutorial: License a LabVIEW Executable Using the Instant Protection PLUS 3 API

Visit the SoftwareKey.com Blog for help Choosing the Best Licensing Method for your LabVIEW Tools.

Goal

This exercise will show how to license a LabVIEW-built executable using the Instant Protection PLUS API. For advanced licensing needs such as Network Floating Licensing, Feature-Based Licensing, and Consumption-based licensing, or to protect 64-bit executables, we have included the instructions on how to get started below.


Prerequisites

  • LabVIEW 2010 or later
  • “LabVIEW Executable” LabVIEW project.
  • Instant Protection PLUS 3 from Concept Software (30-evaluation available at http://www.softwarekey.com/)
  • Internet Connection

Step 1 - Adding the IP2Lib files to your LabVIEW project

Browse to the installation directory (usually C:\Program Files (x86)\SoftwareKey\ or C:\Program Files\SoftwareKey\), go to the "Instant PLUS\samples\IP2Lib DLL\Include\LabVIEW" sub-directory. Copy the following files to your project folder:

  1. IP2Lib.lvlib
  2. IP2Startup.vi (startup VI checking license on application startup)
  3. IP2LIB_Flags.ctl (control with CallIP function flags definitions)

Open your LabVIEW project and add the copied files to your project.
Manual Add File

Step 2 - Project Modification

Double click IP2Startup.vi and open the block diagram (Window ->Show Block Diagram or CTRL+E). All of the necessary modifications are bookmarked with a <#TODO> comment.

 

Important Steps

 

  • Open the Instant Protection PLUS 3 wizard, open your ".ipp" file, and go to the File Output step (requires that you select "Use the Instant Protection PLUS 3 DLL" on the Integration Method step just before it). This dialog will contain 3 pivotal pieces of information you need for the DLL to work with your program:
    1. The decryption key.
    2. The return key/return code.
    3. The name of the file saved.
  • Replace [key]with the Decryption Key from the Instant Protection PLUS 3 wizard as mentioned in step 1. You can do this by simply copying from the wizard and pasting over [key] in the code.
  • Replace [returnCode] in the Case Structure with the Return Key from the Instant Protection PLUS 3 wizard as mentioned in step 1. You can do this by simply copying from the wizard and pasting over [returnCode] in the code.
  • In the IP2Startup.vi, note that the block containing the "filePath" variable is initialized so that it opens the "sample.xml" file from the same location where the program is located. Putting the XML file in the same directory as the program is recommended, and keep in mind that your XML file may have a different name depending on what you specified as the file to save on the "File Output" step of the Instant Protection PLUS 3 wizard.
  • Drag your main or startup VI to its <placeholder> in the Case Structure as shown in the screen shot below.

Manual change data

 

In your LabVIEW project, you will need to add the Instant Protection PLUS 3 DLLs and your XML file to your project as described in the in the deployment topic. Next, open the main or startup VI of your LabVIEW project. Go to File -> VI Properties menu. Select the Window Appearance category. Click the customize button and check the "Show front panel when called" check box.

 

Manual show front panel

Step 3 - Modifying Build Specifications

You will need to change the build specifications of your executable to use IP2Startup.vi as your startup VI. Under Build Specifications, right-click your executable , and click Properties. Click on "Source Files" and remove all VIs from the "Startup VIs" section. Select the IP2Startup.vi and include it in the "Startup VIs".

 

Manual build specifications

 

To correctly initialize the license files (to avoid permission issues on Windows Vista or later) follow the next steps:

Below the Build Specifications of your project, right-click your executable and click Properties. Click on "Advanced" and check the "Pass all command line arguments to application" check box. This will help your application correctly respond to the /OPENLF flag described in step 4.

 

Advanced settings

 

Once you have configured all of your build specifications, click Build. When your executable runs, it will check the Instant Protection PLUS 3 license first. Upon validation, it will pass the execution control to the main VI of your project. When testing your application, be sure to copy your XML file into your executable's build directory. To find your executable's directory, right-click your executable and click Explore.

Step 4 - Deployment

When you are ready to create your application's installer, right-click your installer below the Build Specifications and click Properties. Click on "Advanced" and check the "Run executable at end of installation". Below the command line arguments, enter "/OPENLF" into the text box. Click OK.

 

Installer

 

The application must be properly deployed in order to function correctly on a 'clean' machine that has not previously had Instant Protection PLUS 3 installed. The Instant Protection PLUS 3 DLL library files must be installed to the system directory along with any custom splash screen or product logo images.  Your XML file will need to be deployed to your application's installation folder. These requirements are described in detail in the deployment topic.