Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
1 rating:
 1 out of 5     Rate this Document

How Can I Create a Distributable CD with My LabWindows/CVI Application and NI-DAQ?

Hardware: PXI/CompactPCI>>Controllers

Problem:
I am using the Create Distribution Kit tool in LabWindows/CVI to create an installation CD for my application. I would like to include the NI-DAQ drivers with my CDs to simplify the installation process. I tried using the NI-DAQ setup executable as the "Executable to Run After Setup" in the Advanced Distribution Kit Options, but it does not seem to work. How can I include the drivers with my distribution?

Solution:
There are two paths to follow here: putting the executable and the DAQ drivers on the same CD or using separate CDs for each. NI-DAQ 6.9.3 and earlier should fit on the same CD as your executable, provided the executable is not over 400 MB. However, any version of NI-DAQ after 6.9.3 will most likely be too large to fit on the same CD as your application. The method presented here uses two batch files (Launch.bat and Drivers.bat), but the implementation will vary slightly depending on how many CDs you use. Refer to the two tables below for the code listings, and see the Related Links section for more general information on how to make DOS batch files.

LabWindows/CVI Applicaiton and NI-DAQ on the Same CD
Launch.bat Drivers.bat
@echo off

start cmd /k %1 %2

exit
@echo off

echo Installing NI-DAQ 6.9.3...

%1\Drivers\setup.exe

echo Driver Installation Complete.

pause

exit


LabWindows/CVI Application and NI-DAQ on Separate CDs
Launch.bat Drivers.bat
@echo off

start cmd /k %1 %2

exit
@echo off

echo Please insert the NI-DAQ 7.3 CD now.

pause

echo Installing NI-DAQ 7.3...

%1\setup.exe

echo Driver Installation Complete.

pause

exit


Save these two batch files in a folder you can get to easily as you will need them later on. For your convenience, they are located in the Attachments section below in the SingleCD.zip and MultipleCDs.zip files. Next, follow these steps to set up your LabWindows/CVI Distribution Kit:

  1. Select Build » Create Distribution Kit... from the menu bar. CVI will prompt you to re-build your application if you have not already done so.
  2. There are a lot of settings that you can customize on the window that pops up as you see fit. Take note of the Build Location as this is the folder that you will need to burn onto your installation CD. You can click on the Help button for detailed information on any of the other settings.
  3. At this point, click the "Build" button to do a preliminary build of your distribution kit. This will create the directories that you will need. You will rebuild again once more later.
  4. You will need the two batch (.bat) files listed above to create the distribution. Put both the Launch.bat and Drivers.bat files in the distribution folder (the Build Location folder).
  5. Return to the Build » Create Distribution Kit... window. Everything you changed before should still be the same. Under the File Groups section, click Add Group. Enter a name for this group. A file dialog pops up asking you to select files to add to your group. Locate the Launch.bat, click "Add" and then click "OK."
  6. Click the Advanced button at the bottom of the windows to bring up the Advanced Distribution Kit Options.
  7. Click the "Select" button and find the Launch.bat in the Drivers file group that you just created. Select it with your mouse and click the "Select" button.
  8. In the Command Line Arguments field enter this exactly: %src\CD1\Drivers.bat %src
  9. Click the "OK" button at the bottom of the Advanced Distribution Kit Options window. Then click Build on the main menu. The installer is now comple.
  10. If you are doing a single-CD implementation, create a sub-folder in the Build Location folder called "Drivers." Put the contents of the NI-DAQ installation CD(s) in this folder so that the Drivers.bat file knows where to find them.
  11. If you are using one CD just burn the entire contents of the Build Location folder onto your distributable CD. If you are using more than one CD, build your first CD with just the Build Location folder. The other CDs will hold the NI-DAQ drivers. When you run the installation, the batch file will prompt the user to insert subsequent CDs as the installation proceeds.

There are several customizations available for LabWindows/CVI distribution kits with regard to the Windows Installer technology. Refer to the related links below for more information.

Related Links:
Application Note 178: Customizing Create Distribution Kit Installers in LabWindows/CVI

Attachments:

SingleCD.zip
MultipleCDs.zip






Report Date: 11/12/2004
Last Updated: 02/02/2009
Document ID: 3FB9RIS9

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
  1 2 3 4 5
Please Contact NI for all product and support inquiries.submit