WiX Shortcut Points to the Wrong File

August 09, 2007

I ran into an interesting bug/feature/problem with my WiX 3.0 / Votive installer recently where shortcuts were pointing to the wrong file.  For example in the case of Dubbelbock TFS, I set up a shortcut to Dubbelbock.UI.exe from Startup and from "Benjamin Day Consulting, Inc" in the Programs menu.  What was happening was that rather than starting up Dubbelbock.UI.exe when I logged into my machine, I got Dubbelbock.UI.exe.config popping up in notepad.  (Not exactly what I wanted.)

Here's some sample WiX that has the same problem:

                **         **       

Looking at that code, the elements are contained inside of the element for ClipboardUtility.exe so you'd think that it would create two shortcuts to ClipboardUtility.exe.  Nope.  It creates two shortcuts to "ClipboardUtility.exe.config".

After playing around with it for a while, I figured out that the directives will always create shortcuts to the first in the rather than the that contains the .

So...the moral of the story is always put your 's with 's first in your .

    **                         **       

-Ben

Categories: wix