Book Image

WiX Cookbook

By : Nicholas Matthew Ramirez
1 (1)
Book Image

WiX Cookbook

1 (1)
By: Nicholas Matthew Ramirez

Overview of this book

Table of Contents (20 chapters)
WiX Cookbook
About the Author
About the Reviewers

Creating an advertised shortcut that installs a feature on demand

Ordinarily, when the end user executes one of our installers, all of the components get installed right away. However, when a component is tied to an advertised shortcut, it isn't installed until the user clicks the shortcut that the associated file gets installed. This type of shortcut provides a sort of install-on-demand functionality. You might use it to delay the installation of a feature that many users wouldn't use right away, such as supplementary tools or sample projects.

Getting ready

To prepare for this recipe, perform the following steps:

  1. Create a setup project and name it AdvertisedShortcutInstaller.

  2. Add a C# Console Application project to the same Visual Studio solution and call it SampleApplication. We will include this in our installer, paired with an advertised shortcut so that it won't be installed until the user clicks on the shortcut. Add the following code to its Program.cs file:

    using System;
    namespace SampleApplication...