LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Put shortcut to app in startup folder as part of installation.

I want to put a shortcut to my LV executable into the All Users Startup folder so that anytime a user logs in, the application will start up. I know this can be done manually very easily, but I would like this to happen automatically as part of the installation. I tried creating the shortcut and adding it as a support file, but this has the problem that once you select the shortcut to add, you get the target added to your list instead of the shortcut. I worked around this by putting the shortcut inside a folder and adding the folder contents. When I installed the app, the shortcut was placed in the right location but was corrupted.

The logical use for choosing the Destination Setting to be "Startup Di
rectory" is for this very purpose. It seems like it should be straightforward...

It also noticed that you cannot play the game of renaming the file with a different extension such as TXT - Windows still knows it is a shortcut. Any ideas?
0 Kudos
Message 1 of 6
(4,600 Views)
How about a windows call that creates a shortcut? I don't know myself what it is but there must be one...

Something to look into at least.

Also isn't there a registry setting that specifies programs to start a launch?

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 6
(4,600 Views)
Chris,

I don't know how to create the shortcut, but you can just place a key in the registry to get your executable to run automatically at startup.

You need to create a key with the path to the executable in:
HKEY_LOCAL_MACHINE >> SOFTWARE >> Microsoft >> Windows >> CurrentVersion >> Run

Now to do this automatically in your VI will require more programming. You can create an executable that writes that key and set it to run after the installation or you can set an entrie in your INI file that checks if this is the first time the exe runs; if it is just write the Key and clear the flag in the ini file.

I think you could also use Microsoft's Orca utility to edit the msi file and get it to insert that Key for you (orca comes now with
the windows SDK package).

I hope this helps.

Regards,

Juan Carlos
N.I.
0 Kudos
Message 3 of 6
(4,600 Views)
Thanks, Juan. That sounds like a great way to do it. I was wondering: does this key setting cause the program to auto-launch for all users? Although I originally mentioned all users, I would actually like the program to launch only when one specific user logs in. Is this possible?
0 Kudos
Message 4 of 6
(4,600 Views)
You are right, This will execute for every user that you logs into the computer.

For this case you may want to use a batch file then. Just create a *.bat file that lauches you exe and put it in the startup folder; it's not exactly a shortcut, but it shoult lauch your program.

Hope this helps.

Juan Carlos
N.I.
0 Kudos
Message 5 of 6
(4,600 Views)
The batch file works pretty well. I found that from the app builder I could select "startup folder" which put the batch file in the "All Users" folder. I guess if I had selected the root directory, I could have specified a subdirectory and put it in another user's startup folder.

For anyone interested, here are the lines of my batch file:
---------------
@echo off
start "" "C:\Program Files\App\App.exe"
---------------
Message 6 of 6
(4,600 Views)