Install an App as Auto Startup

J

Joe Cool

To install a .NET app so that it launches when the user logs in all
you had to do was add a folder named Startup to the User's Programs
Menu object the Setup project's file system, anbd create a shortcut in
that folder that runs the app's primary output.

This does not seem to work with Vista or Windows 7, apparently due to
the different location on the disk for the Start menu folder tree.

What's the trick to get this to work on either XP, Vista or Windows 7?
 
P

Peter Duniho

Joe said:
To install a .NET app so that it launches when the user logs in all
you had to do was add a folder named Startup to the User's Programs
Menu object the Setup project's file system, anbd create a shortcut in
that folder that runs the app's primary output.

This does not seem to work with Vista or Windows 7, apparently due to
the different location on the disk for the Start menu folder tree.

What's the trick to get this to work on either XP, Vista or Windows 7?

Actually, for programs that really _need_ to be run when a user logs in,
the "Run" registry key is the right approach. Less susceptible to
accidental user manipulation (they can still disable it using the
msconfig.exe program).

Alternatively, it turns out that that the Task Scheduler has an option
for executing an application when a user logs in (it has a wide variety
of conditions and events that trigger the execution of an application,
and login is one of those possible settings). This is a higher-level
approach that is also less susceptible to accidental manipulation.

If you choose to use the Task Scheduler to implement it, be sure your
application includes a way to disable itself. The msconfig.exe utility
does not yet include Task Scheduler items in its various settings, and
many users aren't accustomed to looking in the Task Scheduler to find
start-at-login programs when they want to disable them.

All that said, you should still be able to use the Startup folder in
post-XP versions of Windows. If you could be more specific about what
you're doing (be very detailed and specific about how you're creating
your Setup project), I think it should be possible to figure out why
what you're trying doesn't work, and what you need to change to make it
work.

Pete
 
J

Joe Cool

Actually, for programs that really _need_ to be run when a user logs in,
  the "Run" registry key is the right approach.  Less susceptible to
accidental user manipulation (they can still disable it using the
msconfig.exe program).

Alternatively, it turns out that that the Task Scheduler has an option
for executing an application when a user logs in (it has a wide variety
of conditions and events that trigger the execution of an application,
and login is one of those possible settings).  This is a higher-level
approach that is also less susceptible to accidental manipulation.

If you choose to use the Task Scheduler to implement it, be sure your
application includes a way to disable itself.  The msconfig.exe utility
does not yet include Task Scheduler items in its various settings, and
many users aren't accustomed to looking in the Task Scheduler to find
start-at-login programs when they want to disable them.

All that said, you should still be able to use the Startup folder in
post-XP versions of Windows.  If you could be more specific about what
you're doing (be very detailed and specific about how you're creating
your Setup project), I think it should be possible to figure out why
what you're trying doesn't work, and what you need to change to make it
work.

Pete

This is just a simple tray app that doesn't belong in the msconfig
startup apps list. Here is how I set one up:

1. Right click the setup project and select View -> File System

2. In the File System window, I right click on User's Programs Menu in
the left hand pane and select Add -> Folder. I name the new folder
Startup.

3. I select the newly created Startup folder. I right click in the
right hand pane and select Create New Shortcut.

4. A window opens with the title "Select Item in Project". I double
click on Application Folder. Since I have already added the project's
Primary Output to the Application Folder, it shows up here. I select
it and click on OK, and edit the display name appropriately.

A setup project created in this manner installs a shortcut in the
user's Startup menu and it launches each time the user logs in.
 
P

Peter Duniho

Joe said:
[...]
2. In the File System window, I right click on User's Programs Menu in
the left hand pane and select Add -> Folder. I name the new folder
Startup.

Okay, there's the mistake. You need to select the "File System" (the
top element of the tree) and then add a "Special Folder": the "User's
Startup Folder".

In that special folder, then you can add the shortcut you want and it
will show up in the startup folder.

Using the "Special Folder" feature allows Setup to find the correct
place to install the shortcut regardless of the OS version. The way you
were doing it, your Setup program was at the mercy of the OS version and
its specific layout.

Hope that helps.

Pete
 
J

Joe Cool

Joe said:
[...]
2. In the File System window, I right click on User's Programs Menu in
the left hand pane and select Add -> Folder. I name the new folder
Startup.

Okay, there's the mistake.  You need to select the "File System" (the
top element of the tree) and then add a "Special Folder": the "User's
Startup Folder".

In that special folder, then you can add the shortcut you want and it
will show up in the startup folder.

Using the "Special Folder" feature allows Setup to find the correct
place to install the shortcut regardless of the OS version.  The way you
were doing it, your Setup program was at the mercy of the OS version and
its specific layout.

Hope that helps.

Pete

That was it. Thanks, Pete.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top