Let's say, for example, my application supports Epson printers and Canon printers.
I would like to have an option during installation, maybe radio buttons or, better, checkboxes (to have an option to choose both) that would say 'Install Epson drivers' and 'Install Canon drivers'.
Then, based on user selection, the setup package would install either only Epson drivers, or only Canon drivers, or both.
I guess what I want can also be described as having several prerequisites, but make them optional.
Any suggestions on where to begin?
Looks like what I need cannot be done from VS Setup and Deployment, as I'm trying to run an msi from msi, which is not permitted. So as a workaround I had to create a small 'wrapper' Windows Forms application with a few checkboxes and a function like this
private void InstallComponent(string filePath)
{
System.Diagnostics.Process installerProcess;
installerProcess = System.Diagnostics.Process.Start(filePath);
while (installerProcess.HasExited == false)
{
//indicate progress to user
Application.DoEvents();
System.Threading.Thread.Sleep(250);
}
}
and the 'Install' button that would do something along the lines of
private void buttonInstall_Click(object sender, EventArgs e)
{
if (checkBoxCanonDrivers.Checked)
{
InstallComponent("CanonSetup.exe");
}
if (checkBoxEpsonDrivers.Checked)
{
InstallComponent("EpsonSetup.exe");
}
// ............
InstallComponent("MyMainApplicationSetup.exe");
}
Now off to make this app flexible, like reading setup file locations from an XML file etc, but that is outside the scope of the question ...