Follow the steps below to add NI License Manager licensing to your LabVIEW applications, to build an application with the correct contents, and create an installer with all necessary dependencies. At this point you should have already requested a license file from National Instruments as instructed here. For more information on licensing third-party products with the NI License Manager API for LabVIEW, refer to this article. Demo code and a demo license are attached to this document.
1. Add the NI License Manager API into your code
In order to have a licensed stand-alone application using NILM you will need to include the NI License Manager API into your application code. There are many ways of accomplishing this, but you can use the NI License Manager Examples VIs as a starting point and copy/paste the code into your application. Note that you will need to ensure your application runs correctly in both 'Evaluation' and 'Activated' license status cases. Below is an example with code added into the NI License Manager example after checking license status.
On the front panel, both in Component’s Component name and Activation Request’s Name fields should be the license name which you have received from LabVIEW Tools Network team. Please note that Activation Request’s Name should contain _PKG at the end of the name.
Note: The version number inputs need to match to the version number in the license file.
2. Build your EXE
In the Project tree right click the Build Specifications and choose New >> Application(EXE):
In Information category specify your application’s name:
In Source Files category place your main VI in the Startup VIs section, all files (e.g. license files) and subVIs move to Always Included section:
Recommendation: In Icon category uncheck Use the default LabVIEW icon file and from the pop-up window choose your own Icon:
After all these steps click Build:
3. Create your Package with NI Package Builder
Download NI Package Manager, go to Add-Ons section and search for LabVIEW Package Builder, click on it and hit Install. After the installation is complete, restart LabVIEW.
Go back to the Project Explorer window, right-click Build Specifications and select New»Package. In the Package Properties dialog box, under Information, enter the name you want to use for your package in Package name. The package name must be all lowercase and contain no spaces. NI Package Manager and other packages use this name to reference the package you create.
Under Destinations, set up any destination folders where you plan to install the package in the client.
Under Source Files, specify which files or build specification outputs you want to install.
(Windows 64-bit) Under Shortcuts, you can add a shortcut to the Startup menu if you want your application to run as soon as the system starts up.
You can also add a shortcut to the Desktop or Program Menu on Windows. By default, LabVIEW adds a shortcut in the Windows Program menu for each application included in the package.
Under Package Attributes, specify the display name and synopsis for your package.
The display name is what users will see in the Package Manager or NI SystemLink when they install your package. The synopsis is the first line of the description that users see before they click on a package to see its full description.
Under Dependencies, specify dependencies on any currently installed packages.
Under Version Information, specify the version of your package and what version you want to display to the user. If you remove the display version, the user sees the full version in the Package Manager.
Under Advanced, set your package to run executables or scripts while it installs or uninstalls. For example, you can specify whether the process for installing or uninstalling the package waits for a certain action to complete.
Click Build. You should see an (Windows 64-bit) .nipkg file or (NI Linux Real-Time) .ipk file in the destination you specified.
You can distribute the package to clients through Package Manager or SystemLink. (Windows 64-bit) Your clients can use Package Manager or SystemLink to subscribe to a feed to find and install your packages.
(NI Linux Real-Time) Your clients can install packages through SystemLink or from the command line on the NI Linux Real-Time target. Package Manager does not support .ipk files.
To have the package available on LabVIEW Tools Network, please submit the product for a review. Check NI Tools Network Application Requirements before submitting.