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.
To prepare for this recipe, perform the following steps:
Create a setup project and name it
AdvertisedShortcutInstaller
.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 itsProgram.cs
file:using System; namespace SampleApplication...