Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI
This Document is not yet Rated  Rate this Document

Configure a LabWindows/CVI Installer to Run as a Startup Windows Application

Primary Software: LabWindows/CVI Development Systems>>Base Package
Primary Software Version: 8.5
Primary Software Fixed Version: N/A
Secondary Software: LabWindows/CVI Development Systems>>Full Development System

Problem:
I am using LabWindows/CVI to create an installer for my application. On my target machine, I want my application to automatically run when Windows starts. How can I configure my installer so that it tells Windows to run my application at startup?

Solution:

You can either place a shortcut to your application in the Startup directory, or you can write the path of your file to the registry under the key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run.
  1. In LabWindows/CVI, click on Build » Distributions and then select Manage Distributions.
  2. Select your installer and click Edit.

Shortcut Method:

  1. Click on the Files tab.
    • Right click on [Start » Programs] and select New Subdirectory.
    • Name this new directory Startup.
  2. Click on the Shortcuts tab. 
    • Right click in the empty whitespace area and select New Shortcut
    • Select your executable from the drop down menu in the Target File column.
    • Select [Start » Programs]\Startup from the drop down menu in the Destination Directory column.
  3. Click OK.

Registry Method:

  1. Click on the Registry Keys tab.
  2. Right click on HKEY_LOCAL_MACHINE\SOFTWARE and select New Key.
  3. Type in Microsoft for the name of the new key.
  4. Continue this process until you have created HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
  5. Now select the Run key.
  6. Right click on the table on the right and select New Value.
  7. You can change the name of this value to whatever you want (preferably the name of your application)
  8. Set the value to the installed path of the file you would like to launch.

    Note: You can't use a hardcoded path, because you (typically) don't know how the file system of the target machine will be configured.  The distribution builder provides a few handy symbolic names which are expanded at install time.  For example, if you wish to run a program named my_app.exe, which is installed to the application directory (shown in bold in the Files tab), you should set the registry key value to "%dest\my_app.exe".  You must put quotes around the path, or it's likely not to work.

Now, after running the installer, your executable will be automatically started when Windows starts up.



Related Links:

Attachments:





Report Date: 11/15/2007
Last Updated: 01/02/2008
Document ID: 4FELKFPO

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