Archived: Distributing Applications with the LabWindows/CVI 8.x Distribution Kit

Publish Date: Apr 30, 2018 | 12 Ratings | 4.00 out of 5 | Print | Submit your review

Overview

This document has been archived and is no longer updated by National Instruments.

Software developers rarely intend for a finished application to be used only on the development computer. Applications are typically distributed to end users and other locations, which is often challenging. One option for distributing code is to purchase the full development environment for each destination PC. However, purchasing licenses is costly and often unnecessary because no further development will be done. Developers need methods for providing stand-alone executables or code modules.

Code distribution is also necessary if developers want to share copies of source code and support files. A large application may have hundreds of files associated with it—not only the code, but also supplementary files such as databases and documents. Manually gathering and packaging all of these files for distribution is a tedious job. Developers need a tool that packages all the relevant files together for easy distribution.

LabWindows/CVI users face these types of issues—test, measurement, and control applications that are nearly always deployed or distributed to a location other than the development PC. To address these scenarios, National Instruments provides the LabWindows/CVI Create Distribution Kit (CDK) to easily package your application, including any drivers or dependencies.

LabWindows/CVI currently supports the Microsoft Windows Installer (.msi) distribution type. The Windows Installer technology packages all built libraries and executables along with any necessary files, drivers, and registry keys into a complete installer that can be run in a single operation on the target machine. Windows installers include versioning information, which enforces correct behavior when performing upgrades, repairs, or reinstallations. They also provide a familiar, professional install-time user interface.

Table of Contents

  1. LabWindows/CVI Distribution Features
  2. Creating a Basic Windows Installer
  3. Running a Windows Installer
  4. How LabWindows/CVI Builds a Windows Installer
  5. Step-by-Step Guide to Creating and Editing an Installer
  6. Troubleshooting

 

Note  The content in this article is replicated from the Help documentation that ships with LabWindows/CVI.  Please refer to Using LabWindows/CVI»Managing Project»Building a Project»Distributing Applications.


1. LabWindows/CVI Distribution Features

A redesigned LabWindows/CVI 8.x distribution kit provides the following key features:

  1. Distributions can include drivers for NI products.
  2. Distributions can include files from multiple projects. You also can associate multiple distributions with a workspace.
  3. You can copy settings from an existing distribution to a new distribution. You can use this feature to quickly create variations on an installation package or create side-by-side installations of the same application.
  4. You can add custom and third-party merge modules (.msm files) to an installer.
  5. You can add custom readme and license information, which the installer displays at run time. The user must accept the license agreement to continue the installation.
  6. At install time, distributions can create shortcuts or registry keys that the application requires.
  7. The LabWindows/CVI user interface for editing a distribution provides a simple view of the directory structure on the target machine. You can use this to view where files will be installed during installation.
  8. Distributions automatically update to reflect changes in project dependencies or target settings.
  9. The versioning information in the distribution provides an upgrade path for the application.

Back to Top

2. Creating a Basic Windows Installer

Complete the following steps to create a basic installer for a LabWindows/CVI project.

  1. Open the LabWindows/CVI workspace that contains the projects you want to distribute.
  2. Select Build»Distributions»Manage Distributions to open the Manage Distributions dialog box.
  3. In the Manage Distributions dialog box, click New to open the New Distribution dialog box. Specify the Name and Settings file for the new installer.
  4. Click OK to exit the New Distribution dialog box. LabWindows/CVI launches the Edit Installer 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 installs the LabWindows/CVI Run-Time Engine by default.

    In many cases, it is not necessary to modify the Edit Installer dialog box options to create an installer that builds successfully. These basic steps assume this case. Click OK to close the Edit Installer dialog box.
  5. In the Manage Distributions dialog box, right-click the installer and select Build. You also can close the Manage Distributions dialog box and select Build»Distributions»Build distribution name to build the installer.
  6. When LabWindows/CVI finishes building the installer, click Close. You now can install the application.

Back to Top

3. Running a Windows Installer

Complete the following steps to run an installer you created in LabWindows/CVI:

  1. By default, LabWindows/CVI creates the installation files in a cvidistkit.ProjectName folder, which is in the same folder as the workspace file. Copy all Volume folders from this directory to the computer on which you want install the application. If there are multiple Volume folders, you can divide them up among the distribution media.
  2. Run setup.exe, which is located in the Volume1 folder.

Back to Top

4. How LabWindows/CVI Builds a Windows Installer

LabWindows/CVI uses the standard Microsoft Windows Installer technology (MSI) to create a compressed database that includes everything that must be installed and tracked on the target machine. Refer to the Microsoft Developer Network Web site at www.msdn.com for more information about this technology. LabWindows/CVI creates a single .msi file for all application files, registry keys, shortcuts, third-party merge modules, and so on. This .msi file installs the application on the target machine.

 

Note  LabWindows/CVI creates the .msi file under the Volume1\bin\dp folder in the installer output directory. Use this .msi database to do any necessary post-build processing with standard installer editing tools, such as the Microsoft Orca database editor.

LabWindows/CVI also adds .msi files for NI components included in the application. These .msi files come from the NI installers for those components. LabWindows/CVI uses a dependency mechanism to automatically, and silently, include all dependencies of included NI components. If you include any NI drivers in the distribution, you may see other support components automatically bundled into the built installer. When you build the installer, LabWindows/CVI prompts you to provide source distributions for the selected drivers and components, unless the source is cached locally on the build computer. If you do not have the original source distributions for which you are prompted or would like to use a different distribution as the source, you must change the source distribution.

The drivers and components for NI products that you include in the installer contain only those features that are installed on the computer on which you build the installer. For example, if you have only 10 of a possible 20 features of an NI product installed on the build computer and then select to include the full version of that product in the installer, the installer might include only the 10 features installed on the build computer, not all 20 features available for that product.

 

Caution  It is possible that running an installer you create in LabWindows/CVI could uninstall certain features of NI products without reinstalling updated versions of those features. This behavior depends on the features installed on the build computer and those installed on the target computer. If the installation upgrades an NI product on the target computer, it may remove features of that product that were present on the target computer but not present on the build computer. The installer displays information to the user that explains what features will be removed as part of the installation before uninstalling any products and gives the user the option to stop the installation.

An 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 target computer, the installer does not replace the higher version of the product with the version from the build computer.

A distribution is comprised of all the .msi files that contain the application and supporting NI products, as well as any additional licenses and support files. These files are connected through a single user interface and setup.exe file.

Back to Top

5. Step-by-Step Guide to Creating and Editing an Installer

Complete the following steps to create and edit an installer:

Manage a Distribution

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.

 

Note  If projects in the current workspace include distribution kits from LabWindows/CVI 7.1 and earlier, LabWindows/CVI displays a dialog box that gives you the option to convert these distribution kits to .cds files. If you choose not to convert the distribution, LabWindows/CVI does not display this dialog box again unless the project is saved again in LabWindows/CVI 7.1 or earlier.

Figure 1: Manage Distributions

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 distribution, click Add and select an existing .cds file. To create a new distribution, click New to open the New Distribution dialog box. Specify the Name and Settings file for the new installer. The Name you specify is used only to identify this distribution; it is not displayed in the installer you build.

The settings (.cds) file contains the information LabWindows/CVI uses to build the installer. 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.

General Settings

Click OK to exit the New Distribution dialog box. LabWindows/CVI launches the Edit Installer dialog box automatically. Use the Edit Installer dialog box to customize the installer. The following points highlight important options in the Edit Installer dialog box. For complete dialog box help, click Help in the dialog box.

 

  • Versioning—Use the Installer Version and Auto-increment options in the General tab to specify versioning information for the installer.

    The Installer Version and a Globally Unique Identifier (GUID) assigned to the distribution ensure proper upgrade behavior. The GUID is assigned when LabWindows/CVI creates the distribution and is not directly accessible. 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 installer. If you disable this option, always use a version number for the current installer build that is higher than the version number for previous builds. If you run the installer on a computer that has a previous installation of the application, the version numbers determine the installer behavior. If the previous installation has a lower version number or the same version number, that installation is completely removed and the new installation replaces it. If the previous installation has a higher version number, the installer completes without making any changes.

    To create side-by-side installations for an application, create a different distribution (.cds file) for each installation. To use the same settings in both distributions, enable the Copy settings from existing file option in the New Distribution dialog box.

 

Figure 2: Edit Installer Dialog - General tab

Files Settings

  • Including Files in the Installer—Use the Files tab to specify which files to include in the installer. The Local Files & Directories browser displays the folders and files on the development computer. The Project Files item in the directory tree provides quick access to all the files associated with each project in the workspace. Browse under the My Computer folder to access additional files. The Installation Files & Directories browser displays the files to be installed on the target computer. The installation locations are symbolic locations that resolve to the proper paths on the installation computer.

    To add one or more files to the installer, select the file(s) in the Local Files & Directories browser and click Add File. LabWindows/CVI adds the selected file(s) to the folder that is selected in the Installation Files & Directories browser. To add the entire contents of a folder to the installer, select the folder in the Local Files & Directories browser and click Add Contents. Alternately, you can drag files or folders from the Local Files & Directories browser or from Windows to the Installation Files & Directories browser. If the filename in the Installation Files & Directories browser is red, the file cannot be found. This might occur if you move or delete a file from a directory. It also might occur if you have not yet built the project output (executable or DLL).

    The folder in bold font in the Installation Files & Directories tree is the application directory. During the installation, the user has the option to move this directory and the files and directories it contains to a different path. To set the application directory, right-click a folder and select Set as Application Directory.
    Note  Do not install DLLs for NI components manually. Instead, use the Drivers & Components tab, which ensures that the installer you are creating supports upgrades and does not uninstall needed files.

    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:
    • 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.

Figure 3: Edit Installer Dialog - Files tab

  • Launching a File after Installation—To launch a file automatically after installation, right-click the file in the Installation Files & Directories 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.

Shortcut Settings

  • Creating Shortcuts—By default, LabWindows/CVI includes a shortcut for the project output under the [Start»Programs] directory. If you want to specify another directory for shortcuts, you must create the directory in the Installation Files & Directories tree in the Files tab.

Figure 4: Edit Installer Dialog - Shortcuts tab

 

Note  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.

Drivers and Components Settings

  • Including Drivers and Components for NI Products—Use the Drviers & Components tab to add NI drivers or support products that the application uses. LabWindows/CVI automatically selects any components it detects that the application is using. To add a custom merge module, click Add Additional Module. LabWindows/CVI adds all selected projects and merge modules, as well as their dependencies, to the installer. Therefore, the installer likely includes extra products or modules in addition to the ones that you select. When you build the installer, LabWindows/CVI prompts you to provide source distributions for the selected drivers and components, unless the source is cached locally on the build computer. If you do not have the original source distributions for which you are prompted or would like to use a different distribution as the source, you must change the source distribution in the Component Source section of the Drivers & Components tab.

Figure 5: Edit Installer Dialog - Drivers and Components tab

The drivers and components for NI products that you include in the installer contain only those features that are installed on the computer on which you build the installer. For example, if you have only 10 of a possible 20 features of an NI product installed on the build computer and then select to include the full version of that product in the installer, the installer might include only the 10 features installed on the build computer, not all 20 features available for that product.

 

Caution  It is possible that running an installer you create in LabWindows/CVI could uninstall certain features of NI products without reinstalling updated versions of those features. This behavior depends on the features installed on the build computer and those installed on the target computer. If the installation upgrades an NI product on the target computer, it may remove features of that product that were present on the target computer but not present on the build computer. The installer displays information to the user that explains what features will be removed as part of the installation before uninstalling any products and gives the user the option to stop the installation.



An 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 installer, the installer will not replace the higher version of the product with the version on the build machine.

Registry Keys Settings

  • 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.

Figure 6: Edit Installer Dialog - Registry Keys tab

Advanced Settings

  • 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. If MAX 4.0 or later is not installed on the target computer, the configuration import fails. Enable the Automatically include all NI products needed to import the configuration file option to automatically include MAX in the installer if it is present on the build computer.
  • Specifying Distribution Media Size—Use the Distribution media size (in MB) option in the Advanced tab to specify the size of the media on which you plan to distribute the installer. LabWindows/CVI attempts to divide the installation parts into Volume folders so that no Volume folder is larger than the size you specify. The media size cannot be smaller than any individual .msi file in the installer. A basic installation for a LabWindows/CVI application that includes the full LabWindows/CVI Run-Time Engine but does not use other NI products is approximately 20 MB. However, if you use additional NI products in the application, which require you to add additional drivers and components, the installer size can increase greatly.

Figure 7: Edit Installer Dialog - Advanced tab

When you specify all the necessary options in the Edit Installer dialog box, click OK to return to the Manage Distributions dialog box.

  1. In the Manage Distributions dialog box, right-click the installer and select Build. If the build fails, troubleshoot the installer.
  2. When LabWindows/CVI finishes building the installer, click Close. You now can install the application.

Back to Top

6. Troubleshooting

When you build a distribution, LabWindows/CVI displays the Building Distribution dialog box to show the build progress. Click Show Build Log to display a log of the build steps and any warnings or errors that occur.

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 in the Edit Installer Files tab and in other locations, such as the Your Readme File or Your License Agreement File fields in the Edit Installer General tab.

 

Back to Top

Bookmark & Share


Ratings

Rate this document

Answered Your Question?
Yes No

Submit