


This is required as a Shortcut cannot serve as the KeyPath for a component when installing non-advertised shortcuts for the current users. The second creates a registry entry on install that indicates the application is installed. The first is a RemoveFolder element, which ensures the ApplicationProgramsFolder is correctly removed from the Start Menu when the user uninstalls the application. In addition to creating the shortcut the component contains two other important pieces. To set an optional icon for the shortcut you need to first include the icon in your installer using the Icon element, then reference it using the Icon attribute on the Shortcut element.

The WorkingDirectory attribute sets the working directory for the shortcut. Notice how it references the full path using the syntax where myapplication.exe was previously defined. The Target attribute points to the executable to launch on disk. The description is an optional attribute for an additional application description. The Name attribute is the text that will be displayed in the Start Menu. The Id attribute is a unique id for the shortcut. The first element is Shortcut and it creates the actual shortcut in the Start Menu. Underneath the DirectoryRef is a single Component to group the elements used to install the Shortcut. By referencing the ApplicationProgramsFolder directory the shortcut will be installed into the user's Start Menu inside the My Application Name folder. The DirectoryRef element is used to refer to the directory structure created in step 1.
