Software used:
- Visual Studio 2010 Pro
- Open an existing Windows form project solution to create a setup file.
- Right-click on solution and in the context menu click Add, then New Project. After that you can see a new project window, in that right side you can select Other Project Types in installed Templates, then select as shown below.

- Now you can see one project in the same solution as setup1. You can see the properties for this project and can change these properties as you wish like Author, Manufacture, etc. as in the following figure:

- Now the real part begins, here I am going to show you how you can import your project files to setup file, for that right-click on this setup1 project and in the context menu select Add, then click Project Output. After that, you can see a pop-up, from this pop up select required items, mainly Primary output and Localized resources (marked in a red square which I have selected).
After adding these items as in above figure you will get the screen as below,
• Here you can see there are three folders on the left side tab called File System,Application FolderThis is your Destination folder where you're going to install or copy the entire application, so here you can add all your project filesUser’s DesktopThis folder is your desktop, here you can put shortcut of an application file.User’s Programs Menu:This folder is your start menu context folder, here also you can put a shortcut of the application file, help file or any documents, etc.• Here on the right side under Setup1 project tree and in inside application folder you can see item name starts with Primary output from <ProjName>, it is the output of your project i.e., it is going to be your main .exe file• And you can also see all your external .dll files required for your project to run. - Now let’s see how to add extra files and folders in these three right side folders,
Firstly, let’s see in the Application Folder as shown below. Right-click on this folder and in the context menu select Add, then click File (What do you want)
• Here, I am going to add two files i.e., one Icon file and Database file, here you can also add documents and whatever you want.After adding files to Application Folder
• Next we can add a shortcut of the application file to User’s Desktop, for this select User’s Desktop folder. On the right side, you can see blank space having heading Name and Type. In that, you can right-click and then in the context menu select Create New Shortcut as shown below.
• Then you will get one pop up box like below, in that select Primary output From <ProjName>, then click OK.
• Now you can see one shortcut file added on that blank space, here you can change the name of shortcut and can give an icon for this shortcut as in the following figure:
• Next you can add a shortcut file to the User’s Program Menu folder as I did in User’s Desktop folder and if you want you can add some document as well in this folder. This folder will come under your Start menu ->All programs folder, so if you want more files to be added then first add one folder into this User’s Programs Menu folder as shown below, then add whatever files you want.
- Now let’s see how you can manage prerequisites, which is required. Run your application like .NET framework 3.0 or 4.0, VS report viewer, and other prerequisites, for this right-click on setup1 in Solution Explorer and select Properties. After that you can see one pop up there you can select the prerequisites button then select what all prerequisites needed for your application to run Select any of the 3 radio buttons (select 1st one Default).

- Now you can design your setup.exe file as in the following figure:
a. You can give a banner imageb. You can change the Copyright Warning message, welcome text, etc. - Now the time to build setup file, for this right-click on Setup1 in Solution Explorer and select Build, That’s it.
After build success, you can see in your project folder one extra folder created. Inside the Debug folder, you can see your setup file as shown below.
Note:
- .msi extension file is the real setup file.
- .exe file calls this .msi file to execute, without .exe file you can run .msi file but not .exe file.
Read more articles on Visual Studio:

Rajendra BhosalePosted Oct 6, 2021, 10:32 AM
When double clicked on installed file getting error as 'You are attempting to open dll file' please help. whatsapp or call on +91 8446539603
PraveenPosted Jun 6, 2021, 5:38 AM
After selecting primary output my dlls are not loading
Ram PrakashPosted Jan 2, 2021, 7:10 AM
How do I add Additional Prerequisites in the installer? Prerequisites section showing only for .net Frameworks for add. I add Additional Prerequisites in the installer? Prerequisites section showing only for .net Frameworks for add.
Venu KommuPosted Aug 26, 2020, 1:30 AM
Thank you so much for great article, it helps me alot to make MSI File. Everything is installing as expected after making MSI installer, but we could not open the installed application. .Exe is working fine, but we are not able to see/run the application either through Desktop link or Programs menu. Appreciate if anyone can suggest me what we are missing. We followed few videos and other documents also, but MSI is not showing the application we have developed.
Ran kumPosted Jun 23, 2020, 1:42 PM
How can I point the MSI target file location to the same path as MSI is located so that user can find the exe or dll easily?
santiago haroPosted Oct 14, 2018, 2:19 PM
Hey, i want to my this in a project but is dosnt work, i did it in a simple proyect and it worked, but in my main project no, (this project has multiples forms and uses images), what should i do?
Praveen MauryaPosted Apr 27, 2018, 2:55 PM
HI RAFNAS ,, I WANT TO CREATE A SETUP FILE WITH MY SQL SERVER DATABASE PLEASE SUGGEST WAHTA TO DO
Bhuvanesh MohankumarPosted May 23, 2016, 1:12 PM
Good one
Thiruppathi RPosted Apr 28, 2016, 7:53 AM
But deployment package is not working....
Thiruppathi RPosted Apr 28, 2016, 7:50 AM
Nice
GokulPosted Apr 16, 2016, 3:11 AM
thanks
Rafnas T PPosted Mar 11, 2016, 2:26 AM
you can select different template from Setup and deployment project like- installShield
Rafnas T PPosted Mar 11, 2016, 2:24 AM
They are not supported for higher versions. http://blogs.msdn.com/b/buckh/archive/2011/03/17/visual-studio-setup-projects-vdproj-will-not-ship-with-future-versions-of-vs.aspx
ali tuncerPosted Mar 11, 2016, 1:17 AM
Hi Rafnas, Can we do this in VS2012-13? I can't see it in Other Project Types.
Rafnas T PPosted Mar 9, 2016, 2:08 AM
Thank you every one
Shailesh UkePosted Mar 9, 2016, 1:04 AM
Nice Article..
Debasis SahaPosted Mar 9, 2016, 12:10 AM
Nice one...
Vignesh ManiPosted Mar 8, 2016, 11:39 AM
Nice
Mohammed IbrahimPosted Mar 8, 2016, 10:24 AM
nice