Creating Stand-Alone Applications with LabVIEW

Create a stand-alone application (.exe) to provide your LabVIEW program to users without providing your source code. To use a stand-alone application, end users need to install the LabVIEW Runtime, not the LabVIEW development environment.

Note This build output requires Application Builder. LabVIEW Professional edition includes Application Builder. If you use another LabVIEW edition, you can purchase the LabVIEW Application Builder Module separately at ni.com.

Before creating a stand-alone application, do the following:

  • Create code to include in the application you create. Include the code in a project.
  • Understand best practices for coding paths in your source code.
  • Prepare the source files for distribution.
  • Save the project. To create a build specification, the project must be saved.

This procedure describes the basic options to create this build specification. For details on each configuration option for the build specification, refer to the links for each page of the dialog box.

To use your LabVIEW project to create a stand-alone application, complete the following steps.

  1. To ensure that the LabVIEW Runtime can load all VIs in the application, include compiled code with all VIs:
    1. In the Project Explorer window, right-click the project and select Properties or select Project » Properties.
    2. Under Project, click Mark Existing Items..., select the VIs in the project, and select Unmark Selected Items.
  2. In the Project Explorer window, right-click Build Specifications and select New » Application (EXE).
  3. Required: Under Source Files, specify which project files to include in the executable.
    1. Required: Add at least one VI to Startup VIs.

      You must define at least one startup VI. A startup VI is a VI that runs and displays immediately when you launch the application.

      A startup VI must be a top-level VI—a VI that calls other subVIs and references but that is not called by any other VI.

    2. Required: Add other dynamic VIs and support files to include in the application with Always Included.

      You can create a VI that implements a custom dialog with information about the application when a user of the application clicks Help » About. Add this VI to the Always Included list. For more information, see Creating an About Dialog Box for a Stand-Alone Application.

    Note You must add certain VIs to the Always Included listbox on the Source Files page in the following situations:
    Item When to Always Include
    Dynamically loaded VIs

    You can also distribute dynamically loaded VIs for an application by including them within a source distribution.

    Custom run-time menus If you save the custom run-time menu for a front panel control as a separate run-time menu file (.rtm).
  4. (Recommended) Under Information, name the application and the build specification, and choose the highest-level save directory for the build product.
  5. (Recommended) Under Destinations, set up the directory structure for the files that the build generates.

    Destination path defines the location of these files relative to the overall save directory for the build you specified in step 4.

    Note If you intend to include this distribution in an installer, specify the build output of the build specification relative to the primary destination of the build specification. For details, see Caveats and Recommendations for Building Installers with LabVIEW.
  6. (Recommended) Under Source File Settings, edit destinations and properties for the files and folders included in the application.

    LabVIEW displays different options based on the type of item you select in Project Files.

    Note Uncheck Remove front panel for a VI in the following situations:
    • If you reference the VI in an application using the Call By Reference node
    • If the VI uses property nodes to set front panel properties
    • If the front panel window of the VI appears to users

    If you remove the front panel window in these cases, the Call By Reference node or property nodes that refer to the front panel window return errors that might affect the behavior of the application.

  7. Optional: If your application uses shared variables, use Shared Variable Deployment to define how to deploy libraries that contain shared variables at run time.
  8. Optional: Under Icon, select an existing application icon or use the Icon Editor to create an application icon.
  9. Optional: Under Version Information, specify the version of the application and provide metadata about your organization.

    For more information about setting versions, refer to Managing Application Versions.

  10. Optional: Under Additional Exclusions, configure options to leave out certain items from the distribution.

    Excluding items can reduce the size of the distribution, improve load times, or reduce memory usage.

  11. Optional: To include any LabVIEW Web services with the distribution, add the service under Web Services.
  12. Optional: Under Pre/Post Build Actions, define VIs to run before or after the build.
  13. Optional: Under Windows Security, configure security features, such as the digital signature and the manifest file for the application.
  14. Optional: Under Run-Time Languages, set the language preferences for items within the distribution, such as dialog boxes and menus.
  15. Optional: Under Advanced, configure settings for debugging, logging, aliases, configuration files, compatibility, and more.

    By default, the application uses a subset of the values in labview\LabVIEW.ini for configuration. You can instead define a custom configuration file for your application. For more information, see Using a Configuration File with a Stand-Alone Application.

    For more information about debugging, see Debugging Applications and Shared Libraries.

  16. Optional: Under Preview, generate a preview of the build to ensure that it appears as you expect.
  17. Apply any updated settings for your build specification by clicking OK.
    The dialog box closes and the build specification name appears in the project under Build Specifications.
  18. Build the distribution.
    OptionDescription
    Interactive
    • Right-click the build specification and select Build.
    • From the Package window, click Build.
    Programmatic Use the Build VI or the ExecuteBuildSpec command line operation.

After building a stand-alone application, consider building a package to distribute your application. If you build an package, you can include any components users will need to run your application. For example, include the LabVIEW Runtime if you will be running your application on a computer that does not have the complete LabVIEW development system installed.

For more information, refer to Creating Packages for Distribution with LabVIEW.