[Source: http://geekswithblogs.net/EltonStoneman]
If you're creating shortcuts in a Wix package, Alex Shevchuk's post From MSI to WiX, Part 10 – Shortcuts is a great resource to follow. As it does, Wix has moved on, and Alex's scripts don't build in the current version (3.0.4318.0 on my box) – the LongName attribute has been deprecated, so remove any instances you find and put the full name in the Name attribute (Wix now takes care of generating a short name).
You may also find a couple of Internal Consistency Evaluator errors:
- ICE50 - shortcut icon extension doesn't match shortcut file's extension, so the shortcut icon won't be correct
- ICE64 - shortcut folders not being tagged in a RemoveFolder element so they're removed on uninstall
I couldn't fix ICE50 as I was pointing to a .htm file and didn't fancy hacking its extension to .exe to keep Wix happy, and although ICE64 is easy to fix (Alex describes how to do this), I'm generating the Wix script with T4 and it proved fiddly to inject the RemoveFolder elements under the correct Component element. So I tried linking and ignoring the errors, just to confirm my shortcuts were creating correctly. The error suppression syntax is:
light -out <outputMsiPath> <inputWixobjPath> -cultures:en-us -sice:ICE50 -sice:ICE64
This built the MSI, and the installer ran correctly. The interesting thing is that the .htm shortcut did have the right icon, and when I uninstalled the package, my shortcut folders were removed too. So it seems ICE50 and ICE64 can be safely suppressed without affecting the user experience.