views:

929

answers:

3

I would like to create a desktop shortcut for my clickonce deployed application. The IDE is VS2005 and there is no need for upgrading to 2008 yet.

Any help would be greatfully appreciated.

A: 

You cannot do this in ClickOnce, and that is by design:

One of the goals of ClickOnce was to make the user experience of installing and running rich client code as "web-like" as possible

[...]

In keeping with the web-like model we wanted to be as minimally invasive as possible in terms of shell footprint and opted to not "spam" the desktop with shortcuts (note that on the XP startmenu will light up with a notification that an app has been installed for ClickOnce apps).

as explained in this thread on social.msdn.microsoft.com.

The only workaround is to create the desktop icon yourself on first startup. But doing so is not recommended.

You might want to reevaluate whether your really need a desktop icon. I personally hate installers which do that.

sleske
what i don't get is the "by design". I guess in VS2008 they don't care about "web-like" since there is an option of creating a desktop shortcut
Chocol8
They've noticed that the web is very popular, but they still don't quite get why. That's why they've also put in stuff like error providers.
MarkJ
+1  A: 

If you have to stay with Visual Studio 2005, your only option is to write code to create the icon. Here's how to do it. However, be aware of the fact that if a user uninstalls your application, the desktop icon won't get removed.

If you ever upgrade to Visual Studio 2008 SP1, you'll get this feature out of the box.

whatknott
Note that you only get this feature out of the box if the project targets .NET 3.5. If you are targeting an earlier version of .NET (because your customer base contains Windows 2000 users, for example), you still need to use the VS 2005 solution.
Richard Dunlap
+1  A: 

Here you go. This explains exactly how to create a desktop shortcut programmatically for a ClckOnce deployment. Creating a Desktop Shortcut for a ClickOnce Application

This works just fine, and there is no risk involved.

RobinDotNet