Creating a Setup and Deployment Project
In this article I will cover the basics of creating a Windows Installer. This article will explain the step by step process of creating a Setup Project.
Step 1: Create a Sample .Net Project. I have named this project as "TestBlogProject".
Figure 1 Sample Project
Create a Setup Project
Open the TestBlogProject in the VS IDE.
Figure 2: Add New Project
Figure 3: Setup Project Dialog
There are five different templates that are available when you select the project type 'Setup and Deployment Projects'.
- Setup Project: Creates a Windows Installer project to which files can be added. This project type is the most generic of the five.
- Web Setup Project: Creates a Windows Installer web project to which files can be added.
- Merge Module Project: Creates a Windows Installer Merge Module project to which files can be added. This project type is most commonly used for using third party products.
- Setup Wizard: Creates a Windows Installer project with the aid of a wizard.
- Cab Project: Creates a Cab project to which files can be added.
Figure 4: Default Setup Project File View
Now that we have an empty Setup Project established.
Let us discuss about the various editors that are available.
Right Click on the Setup Project and Click View.
Click on the File System
The File System (Figure 6) provides you the essential tools to work with the application folder, user's desktop, and the user's programs menu.
Figure 6: File System Editor
The first thing we want to do here is to include the relevant files and folders we wish to install on the user's machine. This is accomplished by right clicking the Application Folder and selecting 'Add'. The following screenshot is an example of something similar you may see.
Figure 7: Add Project Output
Now to add project output files to this folder, Click Project Output.
Click OK.
Merely add one or more of the files that is vital for your application by clicking on File…. Now that you have you files in place.
We could take additional steps such as manipulating the user's desktop with items such as a shortcut, as well you can add a program group to the user's program group.
Create Shortcut
Name the shortcut as you want. I have given the name as TestBlog. Drag and drop to User's Desktop Folder
Figure 9: Desktop Shortcut to application
The next item you find of immense importance is the User Interface Editor. Inside of this editor you may eliminate or include dialogs that are needed for this install project. The following screenshot is the default User Interface that is created when I initially created this setup project (See Figure 10). The only variation is that I have added a Customer Information dialog.
Figure 10: User Interface Editor
To include the Customer Information dialog that I spoke of follow the following steps.
- Under Install right click on the 'Start' node
- Choose 'Add Dialog'
Figure 11: Customer Information
- Select the Customer Information Dialog and click 'OK'
Prerequisites Installation in Windows Installer
Most applications have prerequisites: Components such as the .NET Framework runtime must be available on a target computer in order for the application to run. The deployment tools in Visual Studio include the capability to automatically detect the existence of components during installation and install a predetermined set of prerequisites — a process known as bootstrapping.
This will be achieved as follows:
To choose which prerequisites to install
- In Solution Explorer, select the deployment project and Right Click
- Click Properties.
- In the Property Pages dialog box, expand the Configuration Properties node, and then select the Build property page.
- Click the Prerequisites button.
- In the Prerequisites dialog box, make sure that the Create setup program to install prerequisite components box is checked.
- In the Choose which prerequisites to install list, check the prerequisites that you wish to install, and then click OK.
- In Solution Explorer, select the deployment project, right click.
- Click Properties.
- In the Property Pages dialog box, expand the Configuration Properties node, and then select the Build property page.
- Click the Prerequisites button.
In the Prerequisites dialog box, choose a location:- If you want to deploy the installers for the prerequisites to a vendor, click Download prerequisites from the component vendor's web site.
- If you want to deploy the installers for the prerequisites to the same location as your application installer, click Download prerequisites from the same location as my application.
- If you want to deploy the installers for the prerequisites to a different location, click Download prerequisites from the following location and enter a local path, URL, or file-share location.
- Click OK to continue.
In this article, I have covered adding a new setup project, about File System Editor, adding installer prerequisites to Windows Installer.
Great stuff - really helped me out.
ReplyDeleteI am glad my article helped you.
ReplyDeletetintin:
ReplyDeletefantastic,this is good stuff!
How do you integrate a dialog with textboxes, adding this dialog is a simple as what you do, but at some point you need to acces the properties (e.g. EDITA1, EDITA2,...) how do you do this? In my case I want to enter a "default" value in the texfield that depends on the windows version on the PC. The user can if needed change this value but ofcourse I need to be able to read it afterwards (e.g. when the program is booted).
ReplyDeleteGreat !!!!!!!.
ReplyDeleteHow can we create a setup that can only be installed on one and only one computer.
THank a lot for ur appreaciation.
Manoj
great..Thanks a lot..=D
ReplyDeleteNice post can u please explain how to customize the Prerequisites.
ReplyDeleteI am glad my article helped you
ReplyDeletePlease help me. i have set the prequisites install location --- i have selected *download prequisites from the same location of my application. Please help me.
ReplyDeletehow i can add some third party installer in prerequisites such as xampp, joytick drivers...... its must automatically install while instaling the software.
ReplyDeletethank you
Hi there,
ReplyDeleteI am wondering, If I need to amend again my project(change some codes) do I need to run the setup again? Kindly advise .
I did everything but i can't publish the Project setup1. how can i do it?
ReplyDeleteHi,
ReplyDeleteI did used, but no solution
Thanks But please tell tthat should i add my MS Access Database in Project output.Bcause if i dont add my database in project output then i receives eroor that database not found
ReplyDeleteThank you so much. You are a life saver. I was about to commit suicide you know. Just exaggerating.
ReplyDeleteHow to add ms access database and microsoft viewer report in setup?
ReplyDeletePlease help
how to add a sqlserver database into my setup please help
ReplyDeletewhere is the set up file created
ReplyDeletehow to add a sqlserver database into my setup please help
ReplyDeleteHOW TO ADD SQL SERVER INTO MY PROJECT(WINDOWS APPLICATION BY C#) AND AFTER INSTALLATION IT INTO DIFFERENT COMPUTER, HOW TO SOLVE REMOTE CONNECTION ERROR. PLEASE HELP ME.
ReplyDeleteThanks for your article
ReplyDeleteHi there,
ReplyDeleteI have developed an Excel add-in using MATLB, after I am done with deployment I am left with a dll and the addin. Now, I want to distribute the dll, excel add-in and a Compiler called the Matlab Compiler runlime (MCR), so that the user can install the compiler and run the add-in that was developed. Can I make a set up project that will install the MCR (160 Mb) in a pirticular location of the users machine and copy the dll and the add-in file aswell in that location?
Regards,
Karthik
Hi.
ReplyDeleteCan Anyone tell me how to I create My won Instaling Interface????not using Visual Studio Defalt Instaling Interface...
Is there any way to create multilingual setup project in VS ??? (i mean using VS default Setup Project) Without Using Wix or any other tool.
ReplyDeleteHello Dear..
ReplyDeletei have created on project with sql database.
and when i create setup as above than after an installation i faced an error in connection of database...
i have already use |DataDirectory| for dynamic conection of file.
then plz tell me how create an setup of project with sql databsefile.
send me email on
divyesh07163@gmail.com
dvsbharadva@gmail.com
hopping to be favoured me and thanking to you.,..
how to add a sqlserver database into the setup
ReplyDeleteplease help me...
send me on
libra.diya@gmail.com
how to get desktop shortcut after installation & it has a icon too ?
ReplyDeletehow to add a sqlserver into setup and also how to add Serial Number while setup wizard going on..i mean how add serial number to application in VB.net
ReplyDeleteplz help me
send me answer at atulparmar19@yahoo.co.in
according to my knowledge you have to put the sql server in installing machine first and then should mannually put the database.i use a sql scripts and run it to put my db on that machine..any comments on this??
ReplyDeletethx but i want to include my DB with that EXE??????? Can u help me
ReplyDeleteHow to deploy a vb.net 2008 project with the SQL server-2005 database... I am able to deploy using above procedure but my database is not getting connected.. Il b glad if u could help me...
ReplyDeletehow to deploy a software with sql database??
ReplyDeleteGood Stuff
ReplyDeleteGood Article thankyou :-) helped me a lot.
ReplyDeleteHi, Thanks its very help full to me.
ReplyDeletethanks its really helped me
ReplyDeletei have problem with deployment before deployment everything run ok but when i deploy project & show the report this time its shows Load Report Failed can u help i think in my deployment there no show all the form
ReplyDeleteI want to add a confirmation dialog box for the application version.if previous version is available then ask to remove the previous version.
ReplyDeleteTo attach your 'Access' database: In the figure 4 of this tutorial -> right click on 'Application Folder' -> select 'File...' and then search the *.mdb file on your hard disk. When you compile (Debug or Release) it will copy the database to the App Folder, voilá!. Do the same for the App Icon and configure the shortcuts by looking into this folder for the icon. For SQL databases I'm not sure this same process works, I'll try tomorrow to see if it works, what I'm sure is that you need to enable SQL Server Express on 'Prerequisites' on the last picture in this tutorial, because for SQL you need the server installed and the database attached to it!
ReplyDeletehi ,everyone i m don't understand these concept please explain it............
ReplyDeleteThanks a lot..U did a Nice job,It is really helped us..once again thanks
ReplyDeletehola alguien sabe ya como incluir la base de datos SQL!!
ReplyDeletehi .please help me
ReplyDeletehow to add sql database with set up file
hi please help me
ReplyDeleteI have 2 problems
1) How can we create a setup that can only be installed on one and only one computer
2) HOW TO ADD SQL SERVER INTO MY PROJECT(WINDOWS APPLICATION BY C#) AND AFTER INSTALLATION IT INTO DIFFERENT COMPUTER, HOW TO SOLVE REMOTE CONNECTION ERROR. PLEASE HELP ME.
please send me the steps for these problems.
My mail id : suresh_gotika@yahoo.co.in
HOW TO ADD SQL SERVER INTO MY PROJECT(WINDOWS APPLICATION BY C#) AND ,HOW TO CREATE A LICENCE KEY IN SETUP.. PLEASE HELP ME.
ReplyDeleteTO SEND DETAIL-
My mail id - shiva.chauhan@gmail.com , mydemo.niit@gmail.com
HOW TO ADD SQL SERVER INTO MY PROJECT(WINDOWS APPLICATION BY C#) AND ,HOW TO CREATE A LICENCE KEY IN SETUP.. PLEASE HELP ME.
ReplyDeleteTO SEND DETAIL-
My mail id - shiva.chauhan@gmail.com , mydemo.niit@gmail.com
thanks for being so much helpful.
ReplyDeleteFrom: www.kaszona.com
We would be much obliged if you could include a step by step procedure on how to effectively include the need for a serial in the setup... Thank you
ReplyDeleteCan you give me a link for download? (Setup Project)
ReplyDeleteBest Guide Ever.. i have been looking around for days. Maybe the other explains it well too, BUT its impossible to understand for beginners. And this type of Manual/Guide are always for beginners. Thanks again for your time. AND AS I SAID, BEST GUIDE ever
ReplyDeleteHow can we create a setup file which will work with both 32 and 64bit
ReplyDeleteany idea how to include the run as administrator option in the setup.exe file? iv tried looking everywhere and even tried searching for software which modifies the binary iv found software and modified the binary detalials of the setup.exe but still no luck adding run as administrator to the right click menu items of the setup.exe
ReplyDeleteThanks... it helped me a lot :)
ReplyDeletehi guys nice helping ..
ReplyDeletemy problem is the client computer not having any configure of .net frame work and service pack 3 and no sql server..
i made a simple program in my system of ado.net
this program is running in my system but not running in another as client systme why?
and how to attach a local db space for client
plz help us ..??
i think u can attach file with the help of "download prequisites from local location" and then browse ur mdf file from the system then add....
ReplyDeletehope it works! tc.
Really good article
ReplyDeleteGreat! Thank You :)
ReplyDeleteThank you sir.....This article is really helpful.....You did an awesome job....:)avi
ReplyDeleteI have followed what have said how to do the setup.
ReplyDeleteHow do I publish it with my project? When I do the build publish, it is still the same. it doesn't do what I put in the setup.
Call us at We24Support E-mail support number at 1-866-978-0799 and Enhance your system functioning and keep it clean with We24Support services.
ReplyDeleteE mail Setup and Support
email support
HOW TO ADD SQL SERVER INTO MY PROJECT(WINDOWS APPLICATION BY C#) AND ,HOW TO CREATE A LICENCE KEY IN SETUP.. PLEASE HELP ME.
ReplyDeleteTO SEND DETAIL-
My mail id - rajeshk997@gmail.com
This is very nice but how to give the serial number validation in the customer information.
ReplyDeletethanx alot , guy
ReplyDeleteThis is the very good steps to deployment vs project.
ReplyDeletethanx a lot sir...
hey check this new website www.countcode.com. It's a social network made for programmers, where you can download,share or upload source codes, where you can count your own code lines for free. You have access to the web forum and the web chatroom. we are happy to have you joined to our community!
ReplyDeleteThanks for sharing, it saves my time.
ReplyDeleteThanks a lot for this topic, but I have a question:
ReplyDeleteHow can we create a setup that can only be installed on one and only one computer?
please If you can help me by send steps of this method, because I search via Google several times with no success.
My e-mail : dd_hefzy@yahoo.com
Thanks again
Great !
ReplyDeleteHow can I change the text in the installer page like welcome screen.
e.g. In welcome screen I want 'Welcome to my project 1 Installation' and for other client I want 'Welcome to my project 2 Installation'.
Is there a way to do it using single setup project???
i have a problem
ReplyDeleteafter i install it. some of the codes change, so the first deploy must be in update.. how to update your first deploy with the new one?
pls.. email me..likasjemboy@yahoo.com.ph
How to add the all dll and how to set the registry value to regeditor atomatically
ReplyDeleteHi
ReplyDeleteHow to set the Regedit value atomatically from installed path.Plz help me...
Hi sir
ReplyDeleteHow to add the dlls and main exe.And locate the database and ini file using setup and deployment.Please help me ..
Solution to mail me
sabaritky@gmail.com
Thanks...Its helped me a lot...!!!!
ReplyDeletenothing helped
ReplyDeletethanks a lot... it helped me...
ReplyDeleteThis walk through was very helpful!!!! Thank you so much for posting!!!
ReplyDeleteI written windows service in c# which reads some data from registry.Then I created windows installer using visual Studio 2010 for that service and also adding data to registry required for service. My problem is installer starts installing service before adding data to installer which causes failure in installing the service.I wanted to add data to registry before installing service so that it can use that data.
ReplyDeleteCan anyone tell me how to import the SqlServer database tables into the setup wizard in visual studio 2010 for windows application?
ReplyDeletecause when i create the setup(installation file) ,after installing, my installed application crashes as database is not include during setup creation.
my mailid is samuraisau@yahoo.co.in
Hi,
ReplyDeleteDear Friends i have complete my C# project and its working great,
I have three project such as BLL Project,Interface Project and Win form project.
Now i want to make a Setup / Installation file of my Completed C# project.how can solve the problem. Please help me. please sent the solution in my Email. shakibmist@gmail.com
Greetings,
ReplyDeleteThank you so much for this tutorial. Very straight forward. :D
Good article.. but how do we add the log information for the installer. This would be required when i am packaging the installer / vsix for some project.
ReplyDeletereply is highly appreciated.
Thanks....this was helpful!
ReplyDeletei wanna create a setup file with key in visual studio....can anyone send me steps to achieve my requirement through email.
ReplyDeletemy mail id is: sureshgoud14@gmail.com
How can we create a setup that can only be installed on one and only one computer...?
ReplyDeleteCode to create free and Trial version
ReplyDeleteAwesome Article, thankyou for sharing
ReplyDeletethanks .. this was a good article
ReplyDeleteI have a query
In my project I have created my database in MYSQL (freeware) and connected it through mysql connector now I want to create a setup of my project, is there any way to embed mysql server application to my current project so in one setup file my current project and the server both should be installed in clients computer.
In my project i have created my database in sql express 2005 for windows application bulid in visual studio 2008.now i want to create a setup of my project to embed sqlexpress in my project.so that there will be no need to install sql server .
ReplyDeleteHi All
ReplyDeleteIn my project i need to create a user inteface and validate textbox filds (username , email , passwprd , conform password)during setup and deployment.
I am able to create a user interface dialog (using orca) , In installer class i written the logic for validating user input after click on next button
if user given wrong input able to display the error message box
information.
but problrm is after displying error msg installation was not stopped. I want to stay back at same dialog if user enters wrong input.
Thanks in Advance
hi,
ReplyDeleteI have developed an application using vs 2012 and access database.I am not good in exe file creation..Kindly help me to create the exe file and runing steps..
Jeeshma
hi,
ReplyDeletehow to create setup if crystal reports is used in project.
hi, i just want to use sql server 2012 express in our prequesties list to select in setup. is that possible in vs 2008 setup and deployment
ReplyDeleteThanx it helped me
ReplyDeleteNice Articel.
ReplyDeleteHi, nice method for Creating Setup and Deployment Project Visual Studio 2008.This method also helps in Visual studio 2010.Thanks....
ReplyDelete-Aparna
Theosoft
my data base connection is SqlConnection sc = new SqlConnection("Data Source=MAHESH-pc;Initial Catalog=mahesh10am;Integrated Security=True");.........
ReplyDeletehow to create setup file with database also , and i want to install client system...please help me ,
thi is my mail id::- mbollapu@gmail.c0m
very nice..........
ReplyDeletehow to give own product key in customer information dialog box ...................when we making the setup ......product key is security of the software
ReplyDeletehi can any one send me how to create info file that means when i create setup and install it into machine then some info file will also create at that machine.?????
ReplyDeleteGuys i need help please have a look
thanks
ReplyDeletethanx a lot............. for ur free stuff ............
ReplyDeleteIt is very nice post this blog
ReplyDeletewebsite designing company in India
very nice information this post
ReplyDeletewebsite designing company in India
ReplyDeletehi this is a tejas
i m last year bscit students
i m developing two stand alone system(Windows application) one is housing management system and second gym management system using c# for front end & sql server 2008 management studio for back end….
both project are completely done without any error and bugs..
but i have face problem for setup(.exe file) to both projects…
my problem is my poroject has install & working properly on my pc
In another pc install successfully but not working properly..
error is database can not found..
anyone can help me to how to create proper setup of c#…..
Hi Sir,
ReplyDeleteI m Nadeem Ansari,
How to set Key when we should create setup in visual studio.
Please help...
nadeemansarikjn@gmail.com
Hello Sir,
ReplyDeleteI am maij shaikh
I want to create a setup file including prerequisites in a way that is compatible for both 32 bit and 64 bit machine. And one exe can be used for both machines
Please reply on
maij_shaikh@rediffmail.com
Thanks in advance..
hi i have an issue
ReplyDeleteCould not load file or assembly EPPlus , version=4.0.4.0 , culture=neutral ,public key token=ea159fdaa78159a1 or one of its dependencies. the system cannot find the specified file .
help me with this issue
thanks in advance
Hello Sir
ReplyDeleteI am Akshay
I want to create setup with Product Key and won Image and add other Fils
justlike Database.