Visual Studio Installer how to prompt for install of shortcuts
I am using the basic VS project of Other Project Types\Setup and Deployment\Visual Studio Installer\ Setup Project.
I want to give the user the option of whether or not to create a desktop shortcut to the application. I know how to create a desktop shortcut, but not to make it optional. So far I have not made any custom dialogs for the install, just using the standard interface that VS provided automatically.
Is there any way to provide the user the choice without getting into a whole bunch of customization?
Are many people using this installer? I look around, we have a 5 year old license to InstallShield, but I have also found it to be bulky and more than we need for this application.
I also looked at WiX, but I don't have the time to learn an install package right n开发者_开发百科ow and it looks like a fair learning curve on it.
Basically our install has .NET 4.0 requirements, installs SQL Server CE, a couple other DLL's which are just copied in and populates a structure. I am not using the registry, using the preferred resources approach for that, so it is a very straightforward install.
There several ways to do it, in general… But I don't know the particular steps for Visual Studio installer project.
- Create a feature which contains the Desktop shortcut. If you have feature selection tree in your installer, present this feature as yet anther option.
- With another approach, you'll have to customize one of the existing dialogs or add a new one where you can show a checkbox. The checkbox changes the value of a property which, in its turn, controls the installation of component or feature for Desktop shortcut.
Yet I guess this method is not supported by Visual Studio.
See Microsoft UX guidelines on putting shortcuts on Desktop.
In most cases, it is not necessary to put a shortcut on Desktop unless your target users start your application very often.
The general approach is this:
- create a custom dialog which contains a control that can condition the shortcut, for example a checkbox
- create a custom action which deletes the shortcut after install
- condition it with the checkbox property
This can be done in Visual Studio:
- select your setup project in Solution Explorer
- click User Interface Editor button on top pane in Solution Explorer
- add a Checkboxes dialog under Install -> Start
- customize it to contain only a checkbox that conditions your shortcut
- add your shortcut deletion custom action in Custom Actions Editor page
- condition it with the checkbox property
Some commercial setup authoring tools have this feature built-in.
精彩评论