Wednesday, February 19, 2014

How to create setup project in Visual Studio 2012 or Visual Studio 2013

In this tutorial I will explain the steps of creating exe file for your window application using visual studio 2012 install Shield template. The same example is applicable for creating setup file in visual studio 2013 as well.
In one of the previous article I explained the steps for creating setup in visual studio 2010.

Prerequisites before creating setup project in visual studio 2012 or 2013:
Before creating setup project download InstallShield template for visual studio from this link: Download InstallShield Template .

After installing the setup of InstallShield template open your window application project whose setup you want to create.

Steps to Create Setup Project in Visual Studio 2012 or 2013:

Step 1: Right click on Solution and then select the option Add-> New Project as shown in the picture below:

setup in visual studio 2012

Step 2: In Other Project Types select the option setup and Deployment and name your setup project as shown in the diagram below:

install shield template

Step 3: InstallShield wizard will open select the radio button Activate or Register for free copy of InstallShield as shown in the picture below:

Install shield

Step 4: Enter the Serial Number you got while downloaded the setup and then click on Activate button as shown in the diagram below:

install shield serial

Step 5: After successful activation Project Assistant window will open. Here all the setup steps would be mentioned on the bottom.
First in Application Information Enter company detail, software version etc. as shown in the diagram below:

application information

Step 6: In Next step Select Installation Requirements on bottom and then select the prerequisites for setup installation on any computer as shown in the diagram below:

setup requirement

Step 7: Next Click on Application Files icon on bottom then click on the option Add Project Outputs and then select the check box PrimaryOutput of your desktop application as shown in the diagram below:

primary output for setup

Step 8: Click on Add Files button and select the exe file from the bin/debug folder of your windows application whose setup you want to create as shown in the picture below:

Note: If the exe is not present in bin/debug folder then it means you need to build the project first.

bin debug folder

Step 9: Next click on Application Shortcuts and select the checkbox create shortcut on desktop. You can also select the icon image for the setup shortcut as shown in the picture below:

desktop shortcut for setup

Step 10: Save all the changes or you can customize other  option as well according to your requirement. After saving all the changes done above build the setup project as shown in the snapshot below:

build setup

Step 11: Open the folder on the computer where you saved the setup project and then browse for the folder Your Setup Name->Express->DVD-5->DiskImages->DISK1 as you can see the full path to setup file in the snapshot given below:

window setup

If you do find any problem any of the steps given here then ask your queries through comments.


  1. I do not get the Tree in the small windows of the fig. in Step 7 where I have to check up PrimaryOutput ... Is It there something wrong... I use VS2103 Ultimate Edition

    1. @Plamen Minchev:
      Please check that in Step 7 you clicked on Add Project Output option or not. If problem persist then let me know.

  2. when I try to create the install shield project I get no dialog box with radio buttons, all it does is create a directory then at the bottom it says that the creation of the project failed? Any Idea why this is happening and how to fix it?

    1. @ chales wooley : please make sure that you have installed install shield first before creating setup project. It would be helpful if you can provide more info such as snapshot of error you are getting.
      Or you can add me on my skype id : mkumar12406 so I can look into your problem using team viewer.

  3. how to create database connection to setup file in installshield in vs2012

  4. I want to deploy my c# project with database in other machine. so please tel me what things i must consider to deploy my project to other pc's?

  5. hi,
    i have created setup already but i have problem like if i copy .msi it says some missing dll errors all time it seems to be working from the same folder where program file folder resides. any idea how to avoid referencing those folder files ?

  6. Can you tell me how to add Databse

  7. i have a window form application with a external sqldatabase when i use your steps then it's work fine and the window form application setup run in my cumputer easly and insert and retrieve data from database but when i install this setup file in other cumputer then the database not working
    plz give me some solution.........

  8. I have a windows form application with database attached to it but i am unable to run exe...
    Also tell me how to attach database files in install shield.. please reply

    1. SqlConnection con = new SqlConnection(@"Data Source=.\SQLEXPRESS;Initial Catalog=master;integrated Security=true");

      SqlDataAdapter da = new SqlDataAdapter("select name from sys.databases", con);
      DataTable dt = new DataTable();

      string[] array = dt
      .Select(row => row.Field("Name"))

      if (!array.Contains("SemiAuto", StringComparer.OrdinalIgnoreCase))
      SqlCommand cmd = new SqlCommand("sp_attach_db");
      cmd.Connection = con;
      cmd.CommandType = CommandType.StoredProcedure;
      cmd.Parameters.AddWithValue("@dbname", "SemiAuto");
      cmd.Parameters.AddWithValue("@filename1", Application.StartupPath.ToString() + @"\DB\" + "SemiAuto.mdf");


  9. I have a windows form application with database attached to it but i am unable to run exe...
    Also tell me how to attach database files in install shield.. please reply

  10. how do i product key while preparing set up..plzzzzzzzzzzzzzz

  11. how do i add and verify i product key while preparing set up..plzzzzzzzzzzzzzz

    1. string hex = GetMACAddress().Replace(":", "");
      hex = hex.TrimStart('0');
      // txtSerialKey.Text = hex;
      UInt64 macAsNumber = Convert.ToUInt64(hex, 16);
      string _Hexaa = string.Format("{0:x}", macAsNumber).ToUpper();
      if (dt.Rows[0]["ProductKey"].ToString() == macAsNumber.ToString())
      your coding here

  12. Thanks for sharing your info. I really appreciate your efforts and I will be waiting for your further write.
    Thanks for sharing !
    five night at freddys 2 | five night at freddys 4 |
    2048 game online| fireboy and watergirl | tanki online 3