Sunday, March 1, 2009

ClickOnce createDesktopShortcut option

.NET 3.5 SP1 introduced the possibility to specify the creation of a desktop shortcut during a ClickOnce installation. Unfortunately this option is not available in the MageUI installed with the SDK v6.1.

If you set this option in VS2008 on a project that is targeting .NET 3.5, you will get a createDesktopShortcut attribute added to the deployment manifest:

Before:
<deployment install="true" mapFileExtensions="true">

After:
<deployment install="true" mapFileExtensions="true" co.v1:createDesktopShortcut="true">

If you deploy this to a machine with .NET 3.5 without SP1, the shortcut will not be added. but if you deploy this to a .NET 3.5 SP1 machine, you will get the desktop shortcut.

So, how to add get this behavior if you are not using the Publish workflow of VS2008? One way is to manually add the attribute to your deployment manifest (program.application). Once you do this, you can freely use MageUI to open the manifest, make other changes and re-save it, it will not remove the attribute.

2 comments:

David Simmonds said...

I do not see any place in VS 2008 to set the ability to create a desktop shortcut for ClickOnce. I have Target Framework set to .NET Framework 3.5. Where do I find the checkbox?

David Simmonds said...

Oops. I misread the About dialog in VS2008. I have SP1 for .NET 3.5, not for VS2008. I'll install VS2008 SP1 and see what happens.