Step-by-Step Guide to Creating and Editing a Package
- Updated2023-02-21
- 7 minute(s) read
This topic provides a detailed guide to creating and editing a package in LabWindows/CVI. It also provides troubleshooting information. However, this topic does not describe every option in each tab of the Edit Package dialog box. Click Help in the Edit Package dialog box for complete dialog box help. For more information about distributing LabWindows/CVI applications, refer to the Distribution Overview.
Complete the following steps to create and edit a package:
- Open the LabWindows/CVI workspace that contains the projects you want to distribute. Then select Build»Distributions»Manage Distributions to open the Manage Distributions dialog box.
- In the Manage Distributions dialog box, you can create a new distribution or add an existing distribution to the current workspace. To add an existing package distribution, click Add and select an existing .cds file. To create a new package distribution, click New to open the New Distribution dialog box. Set the Type to either Package or Package Installer Patch. Specify the Supported OS, the Name, and Settings file for the new package. The Name you specify is used only to identify this distribution and as the default package name.
The settings (.cds) file contains the information LabWindows/CVI uses to build the package. You can share .cds files between workspaces. By default, LabWindows/CVI saves the .cds file in the directory in which the workspace file is saved. You cannot specify an existing .cds file as the Settings file in the New Distribution dialog box. To copy the settings from an existing file, enable the Copy settings from existing file option and browse to the file. - Click OK to exit the New Distribution dialog box. LabWindows/CVI launches the Edit Package dialog box automatically. By default, LabWindows/CVI adds the project output, project DLL dependencies (if there are any), and any other project files (excluding .h, .c, .fp, and .lib files) to the installation. LabWindows/CVI also creates a shortcut for the installed application and selects the LabWindows/CVI Runtime as a dependency by default. Use the Edit Package dialog box to customize the package.
When you specify all the necessary options in the Edit Package dialog box, click OK to return to the Manage Distributions dialog box. Use the Edit Package dialog box to customize the package. The following points highlight important options in the Edit Package dialog box. For complete dialog box help, click Help in the dialog box.
VersioningUse the Version options in the General tab to specify versioning information for the package.
National Instruments recommends that you leave the Auto-increment option enabled. When you enable this option, LabWindows/CVI increments the version number each time you successfully build the package. If you disable this option, always use a version number for the current package build that is higher than the version number for previous builds. If you run the package on a computer that has a previous installation of the application, the version numbers determine the package installation behavior. If the previous installation has a lower version number, that installation is completely removed and the new installation replaces it. If the previous installation has a higher version number, the package installation completes without making any changes.
Note You can also edit the version for package installer patch distributions, but the version of the patch must be strictly greater than the target.
Including Files in the PackageThe folder in bold font in the Destinations tree is the application directory. To set the application directory, right-click a folder and select Set as Application Directory.
By default, LabWindows/CVI adds the project output, project DLL dependencies, and any other project files (excluding .h, .c, .fp, and .lib files) to the application directory of the installation. The Project Name DLL Dependencies item lists DLLs that the LabWindows/CVI linker detects are required for the project. These dependencies typically result when the project includes import libraries or instrument drivers that are associated with DLLs. If LabWindows/CVI does not detect any required DLLs, LabWindows/CVI does not list any DLLs and the size for this item is zero. The Project Name Output item represents different files, which depend on the project target type, as follows:
Note Do not install DLLs for NI components manually. Instead, use the Dependencies tab, which ensures that the package you are creating supports upgrades and does not uninstall needed files. - If the target type is executable, Project Name Output is the .exe file.
- If the target type is DLL, Project Name Output is the DLL and import library.
- If the target type is static library, Project Name Output is the .lib file.
- If you create a new shortcut, you must specify both the Target File and Destination Directory in the Shortcuts tab. If you do not specify these items, LabWindows/CVI removes the shortcut when you click OK.
- If the output type in the General tab is a Single Package, your package will only reference the selected dependencies. If the output type is either Repository or Package Installer, the selected dependencies will be included alongside your package.
- In the Manage Distributions dialog box, right-click the package and select Build. If the build fails, troubleshoot the package using the instructions at the bottom of this page.
- When LabWindows/CVI finishes building the package, click Close. You now can install the package.
Launching a File after Installation
To launch a file automatically after installation, right-click the file in the Destinations browser in the Files tab, select File Options, and enable the Launch after Installation option. The application is launched with the application associated with its file type on the target computer.
Creating Shortcuts
By default, LabWindows/CVI includes a shortcut for the project output under the ProgramMenu directory. If you want to specify another directory for shortcuts, you must create the directory in the Destinations tree in the Files tab.
![]() |
Note
|
Configuring Dependencies
Use the Dependencies tab to add packages of NI drivers or support products that the application uses to your package.
![]() |
Note
|
A package installer will not downgrade an NI product. If you have one version of an NI product installed on the build computer and a higher version of that product installed on the computer on which you run the package installer, the package installer will not replace the higher version of the product with the version on the build machine.
Adding Registry Keys
Use the Registry Keys tab to add registry keys as part of the installation. To create a new key, right-click the hive key under which you want to add the registry key and select New Key. To edit the default value for the key, right-click (Default) in the values table and select Edit Value. To create a new named value, right-click the values table and select New Value.
Including a Hardware Configuration
Enable the Import Measurement & Automation Explorer Configuration File option in the Advanced tab to provide the path to an NI Measurement and Automation Explorer (MAX) hardware configuration file and import the file as part of the installation.
The installer schedules to import the configuration file into MAX the next time the computer is rebooted. Enable the Include MAX option to automatically include MAX in the package installer.
For more information about each of the tab options in the Edit Package dialog box, refer to the following resources:
General Tab
Files Tab
Shortcuts Tab
Dependencies Tab
Registry Keys Tab
Advanced Tab
Troubleshooting
When you build a distribution, LabWindows/CVI displays the Building Distribution dialog box to show the build progress. This dialog box also displays diagnostic messages, allowing you to debug settings and fix any issues. For example, a build can fail if you include a file in the build that is not present on your computer. LabWindows/CVI marks missing files with red text, including missing files on the Files tab of the Edit Package dialog box and in other locations, such as the License Agreements files on the General tab of the Edit Package dialog box. Refer to Distribution Errors and Warnings for more information about Building Distribution dialog box messages.