Example Code

Automating the Installation of a Single Installer

Problem:
I have a single installer as opposed to a bundled Software Suite or LabVIEW Platform DVD.  How can I automate the installation of National Instruments software?  How can I suppress the installer's dialog boxes, user interface, and progress bar?

Solution:
Note that this KnowledgeBase covers a specific type and version of NI Installer:

  • Single product NI installers.  It does not cover multi-product installers (ex:  LabVIEW 8.6+ Platform DVD).  For multi-product installers, please refer to KnowledgeBase 4CJDP38M.
  • This solution pertains to current NI Installers (version 2.5+).  Refer to KnowledgeBase 4CJDR18M to determine your version.  For older versions, refer to KnowledgeBase  3X8BAP96 for that version's solution.

Supported Installation Modes:

  1. Silent:  Lacks dialogs, GUI configuration, and a progress bar.
  2. Basic:  Silent Installation with a progress bar.
  3. Basic Full:  Lacks pre-install GUI, but has post-install GUI elements like NI Activation Wizard.  Also contains a progress bar.
  4. Customized.

Default Installation Commands

To start one of these special modes, use a Windows command prompt by navigating to Start»Run and type cmd.  Once you have a command prompt window open locate your distribution setup.exe file.  If the distribution is on disc, you can find the distribution setup.exe under <drive>:\setup.exe.

  1. Silent:  setup /q /AcceptLicenses yes
  2. Basic:  setup /qb /AcceptLicenses yes
  3. Basic Full:  setup /qf /AcceptLicenses yes


Customizing Installation Configuration with a Silent or Basic Installation
National Instruments installers use a configuration file, called a spec file, as a replacement for the configuration dialogs.  This spec file can contain information about the user, serial number information, which features to install and to not install, etc.

  • Create the spec file:
    The installer can be run in a spec file generation mode.  In this mode, you can enter in user information, the serial number, and select each feature that you would like to have installed or not installed.  You can also leave fields to a default value.  You can run the installer in spec file generation mode using the following command:
    setup /generatespecfile [spec file name]


    The installation dialog will appear.  Instructions on the fields in each dialog exist at the bottom of the user interface.  Once you walk through all of the dialogs, a spec file will be created which you can use to install the software silently.
    • Note: The spec file does not need to exist in advance.
    • Note: To find out how to manually edit the spec file, please see KnowledgeBase 3X8BAP96.

  • Running the installer with the spec file:
    The installer can be run with the spec file by using the following command:
    setup [SpecFile] /q /AcceptLicenses yes
    • Note: You can also use /qb and /qf in replace of /q.  See the first section for more information.

You can view the installer options at any time by using the following command: setup /h.  A dialog similar to the following will appear:

Related Links:
KnowledgeBase 4CJDR18M: How Can I Determine the Type and Version of My National Instruments Installe...
KnowledgeBase 4CKEFN8M: Can I Update My Installer to Take Advantage of Spec File Generation?
KnowledgeBase 3X8BAP96: Automating the Installation of National Instruments Software - NI Installers...
KnowledgeBase 2LNEFGO9: Silent Installation of the LabVIEW Run-Time Engine
KnowledgeBase 2HPDNSLD: Installing a LabVIEW Executable and LabVIEW Run-Time Engine Quietly

KnowledgeBase GGGDQH0: Automating the Installation of a Suited Installer
KnowledgeBase 4KLG5OH0: Automating Uninstallation of NI Software
KnowledgeBase 4H38UPXU: Requesting Permissions from VLM during Mass Software Installations
KnowledgeBase 4H3EE0XU: Large Scale Software Installation
KnowledgeBase 4IH9QMH0: How Can I use Microsoft SMS to Deploy NI Software

Cheers,

David Goldberg
National Instruments
Software R&D

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
Briton
Member
Member
on

Hi

Please update this document and related links to cover LV2008 - LV2012.

Regards

Bjarne

Contributors