In this article i will describe the following points regarding setup and deployment of visual studio application..
- How to add prerequisites in your setup file.
- How to set install location for prerequisites.
Today or in future you want to add prerequisites with your setup file. When we develop an application using any platform, we should prepare our application to be deployed properly.
Prerequisites means a thing that is required as a prior condition for something else to happen or exist. Let me give you an example : Suppose your setup file runs on .Net framework 3.5 and user don't have .Net Framework 3.5. Now in this situation, user will have to either install it himself from the internet or this will be provided by you. But you cannot give two setup files to the user one is for .net framework and other one is for your application. Instead of this you need to add .net framework 3.5 in your application so that user don't need to download and install it separately. All of it's dependencies shold be in one setup file. Hope you will understand what i am trying to say.
Here, I explain how to add .Net Framework or other dependencies files to be installed before our application installation process. We can also say how to add prerequisites in the visual studio setup file. Just follow the following steps :
Open your setup and deployment Project.
Right Click on your Setup project and Click on Properties.
You can see "Property Pages" dialog box.
Click on "Prerequisites" Button.
You can see "Prerequisites" dialog box. Select Prerequisites of your choice, whichever you want to add in your setp file. For ex. .Net Framework 3.5, Sql Express or any other.
Now the next step is you have to specify the install location for Prerequisites.
Select "Download prerequisites from the same location as my application" radio button.
With this option your application search for prerequisites within your application and start installing from there. If you choose "Download prerequisites from the component vendor's web site" then your application install the prerequisites online from microsoft website. You can also specify your custom location with the third option.
Hit OK button. Now build your application.
Open the debug folder of your setup application. In my case it is : C:\Users\mypc\Documents\Visual Studio 2010\Projects\Setup1\Setup1\Debug.
You can see your setup files and also the prerequisites you have recently added in your application. Now when you run your setup file, your setup file will install .net framework or sql express from here.
Keep coding and stay in touch with SetpCoder.