LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How to config installer to let program autorun when windows startup (Labwindows)

Hi,
in Labwindows 8.0, How to config installer to let program autorun when windows startup?
that is, How to edit the installer, after built the distribution, when the end user run the setup, it can set the program auto run when windows startup?
0 Kudos
Message 1 of 4
(3,869 Views)
Hi,
I tried to get it done by editting the "Shortcuts" in "Edit installer" panel.
thanks

0 Kudos
Message 2 of 4
(3,852 Views)
Hi LV_allen,

In order to have an installer run automatically at Windows startup, you will need to add the path to the installer to the RunOnce registry key.  This key is designed to be used primarily by Setup programs. Entries in this key are started once and then are deleted from the key. If there a exclamation point preceding the value of the key, the entry will not be deleted until after the program completes, otherwise it will be deleted before the program runs. This is important, because if the exclamation point is not used, and the program referenced in this key fails to complete, it will not run again as it will have already been deleted. All entries in this key are started synchronously in an undefined order.

You can automatically add entries to this key from a batch file which could be set to run at the end of the installer.  There are a large number of resources on how to programmatically add registry keys from a batch file that can be found by searching Google for "registry batch add"
0 Kudos
Message 3 of 4
(3,822 Views)
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 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run.

Option 1:
If you want to use the shortcut method, on the Files tab of the Edit Installer dialog, make sure you have the [Start>>Programs] in the tree, then create a subdirectory "Startup" underneath it. Now on the Shortcuts tab, "[Start>>Programs]\Startup" will appear in the ring for the shortcut destination directory.  If you create a shortcut to your application in this directory, it will be run when the computer starts up.

Option 2:
From the Registry Keys tab, you can build the path HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run by repeatedly selecting New Key from the right-click menu of the registry tree. Then highlight the Run key and select "New Value" from the right-click menu of the value table on the right. You can change the name of this value to whatever you want (preferably the name of your application), but you must set the value to the installed path of the file you want to launch. You can't use a simple hardcoded path, because you (usually) don't know what the filesystem of the target machine will look like, but the distribution builder provides a few handy symbolic names which are expanded at install time.  If you wish to run your program my_app.exe, which you install to the application directory (shown in bold in the Files tab), you should set the registry key value to "%dest\my_app.exe".  Make sure you do put quotes around the path, or it's likely not to work.

If you have any trouble, let me know.

Mert A.
National Instruments
0 Kudos
Message 4 of 4
(3,809 Views)