I would like to create a desktop shortcut for my ClickOnce deployed application. The IDE is Visual Studio 2005 and there isn't any need for upgrading to Visual Studio 2008 yet.
3 Answers
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.
- 1
- 1
- 12,419
- 8
- 49
- 60
-
3Note 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 Aug 13 '09 at 18:00
The blog post Creating a Desktop Shortcut for a ClickOnce Application explains exactly how to create a desktop shortcut programmatically for a ClickOnce deployment.
This works just fine, and there isn't any risk involved.
- 30,030
- 21
- 100
- 124
- 11,801
- 2
- 28
- 33
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.
- 77,633
- 33
- 182
- 219
-
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 – OrElse Aug 12 '09 at 11:04
-
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 Aug 12 '09 at 11:35