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.
- In LabWindows/CVI, click on Build » Distributions and then select Manage Distributions.
- Select your installer and click Edit.
Shortcut Method:
- Click on the Files tab.
- Right click on [Start » Programs] and select New Subdirectory.
- Name this new directory Startup.
- 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.
- Click OK.
Registry Method:
- Click on the Registry Keys tab.
- Right click on HKEY_LOCAL_MACHINE\SOFTWARE and select New Key.
- Type in Microsoft for the name of the new key.
- Continue this process until you have created HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
- Now select the Run key.
- Right click on the table on the right and select New Value.
- You can change the name of this value to whatever you want (preferably the name of your application)
- 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