views:

87

answers:

1

In some, but not all, of our click-once applications when the user copies the icon to the desktop the icon will be deleted when the user updates the application. What causes this and how do I prevent it from happening?

+1  A: 

I'm assuming you are not targeting .NET 3.5; if you are, you can check the box in the deployment properties to have it create the desktop shortcut automatically.

I think this is why this problem you're having started happening. I think in .NET 3.5 SP-1, Microsoft started removing the desktop shortcut if it existed, assuming you were going to use .NET 3.5 and have it put the desktop shortcut there for you. Isn't that kind of them?

For people (like myself) who are not targeting .NET 3.5 or .NET 4.0, you can add a bit of code to your program's startup that will create the desktop shortcut every time the user runs the application (or whenever you want). For more information, check out this blog post.

RobinDotNet
That's correct. I'm using VS2010 to push out a 2.0 app.
jeffspost
My situation is I have one user who likes a desktop icon and the others don't. I don't think they'd appreciate it if everyone has the icon. I guess I could Db control it and push it out to specified users...ick!
jeffspost
You could make it a user setting in the application. Then the first time they install it, put the desktop icon there. The next time, you can check the setting and decide whether or not to create it. Like I said above, if they have .NET 3.5, it will remove the shortcut when there's an update. Then you can decide whether to replace it or not.
RobinDotNet