In this article I will explain how add dependencies or prerequisites to a setup project
A project we create may be dependent on some other software to work properly. We can add dependencies or prerequisites to these software components in our setup project to ensure availability of the required pre installation software. For example we can add dependency to “SQL Server 2005 Express Edition” in our setup project. After adding a dependency software component, the setup will only install on the target machine if that software component is already installed on it otherwise it will prompt to install the software component. Following are the steps to add prerequisites to a setup project
Create a new setup project or open an existing one. Right click on the setup project in the Solution Explorer and click on Property to open setup project Property Pages
Click on the “Prerequisites…” button in the “Property Pages” dialog (Step 1) to open the “Prerequisites” dialog box
Scroll down and check “SQL Server 2005 Express Edition SP2 (x86)” and click “OK”
You can also specify the install location for prerequisites you have added. In the default option, it will download prerequisite software from its site and will give you an option to install it using a web setup. Specify second option if you want prerequisites to be downloaded from the same location as your application. You can specify third option when you have stored prerequisites at some other location.
If you run the setup and your system lacks any of the prerequisites you have added, you will be prompted with a EULA dialog box for every prerequisites with “Accept” and “Don’t Accept” dialog box.
Prerequisite software will be installed when you click on “Accept”. It will be downloaded from its site so you need internet connection to install it. I have added dependency for “SQL Server Compact 3.5” and it is not installed on my system so I am prompted to install it.
Install will be cancelled when you click on “Don’t Accept” button. You can also install prerequisite software using an offline installer and re run the setup.