How To Create Setup file Visual Studio C#.NET Project

Setup File Visual Studio-technirmiti

When using an IDE like Visual Studio, we test the project by simply debugging it in the IDE itself. For Web applications once these are completely developed we host them on the Web server. Where as for Windows applications, one need to install it and use. Creating the installation file is a separate project itself. So here is the guide on how to create such setup file (.exe file) for Windows Application developed in Visual Studio 2010.

Step 1: Create a Setup Project for Windows Application

We have developed a project named Scanner already for which we will be creating a setup file. We need to add new Setup project to the Scanner project.

  • Right click on the Solution(Not actual Project) of the project in Solution Explorer as shown below:

Setup file Visual Studio-technirmiti

  • Go to Other Project Types -> Setup and Deployment -> Visual Studio Installer and select Setup Project as shown below:

Setup file Visual Studio-technirmiti

We have named the Setup project as Inventory-Management-System. This Setup project, Inventory-Management-System will be displayed in a Solution Explorer.

Step 2: Change the way Application Looks on User’s PC

We will change two things here: How your application looks as a User’s Desktop icon and how it looks in User’s Programs Menu.

  • Right Click on Setup project, Inventory-Management-System-> View -> File System. You will see 3 Folders there:
    • Application Folder
    • User’s Desktop
    • User’s Programs Menu

We will have to add Project Output to Application Folder.

  • For that, click on Application Folder and Right Click on the Details Pane -> Add -> Project Output. (Refer Diagram)

Setup file Visual Studio-technirmiti

  • You will see the New Window to add Project Output. Select the Project Scanner and Select Primary Output.

Setup file Visual Studio-technirmiti

Next, we need to create the shortcuts of our application for the User’s Desktop and User’s Program Menu which user will see after installation.

  • For that, Click on User’s Desktop and Right Click on the Details pane -> Create New Shortcut.
  • Select the Primary Output of the project from Application Folder we just added.
  • Name that shortcut as InventorySystem. (This name will appear for Desktop Shortcut)

Setup file Visual Studio-technirmiti

Setup file Visual Studio-technirmiti

We can also set the icon for the application by going to the properties of that shortcut.

  • Click on Icon -> Browse

Setup file Visual Studio-technirmiti

  • Once you click browse, this icon file should be added to the Application Folder. So, go to Application Folder -> Add File -> Browse the computer for .ico file and say Add.

In this way Shortcut, Shortcut name and Shortcut Icon are added for a User’s Desktop. Follow the same process for User’s Programs Menu.

We can also give the Owner’s information, Developer’s Information and Developer’s URL by changing the properties of the Setup Project as shown:

Setup file Visual Studio-technirmiti

Step 3: Set the Folder for Setup File

Next step is to set the folder for setup file to save.

  • For that, right click on Setup Project in Solution Explorer and click on Properties.
  • Select Release folder.
  • Select “Optimized For Speed” and click OK.
  • You can also set Prerequisites here for the software if required.

Setup file Visual Studio-technirmiti

Step 4: Build the Project

Last step is to build the project.

  • Right click on Setup project Inventory-Management-System -> Build.

Once the build is succeeded, check for the setup file.

  • Go to the same location as your main project and search for your Setup project (Inventory-Management-System) and check Debug folder. That’s your setup file.

If you like this tutorial, please share among your friends. Any comments are always welcome. Stay connected to our blog to learn more about programming.

You may like How to add Splash Screen to Windows App in VS10 C#

 

mm

About Sunayana Gawde

Sunayana Gawde is Project Manager at TechNirmiti Solutions and the Author at TechOpinion. She is a researcher in the field of Computer Science and Technology. She loves to write about Technology. You can follow her on Facebook Twitter and Google+.

4 thoughts on “How To Create Setup file Visual Studio C#.NET Project

  1. Hello, i believe that i saw you visited my web site thus i got here to return the want?.I am attempting to find
    things to improve my site!I assume its adequate to make use of some of your ideas!!

  2. Howdy! This is my first visit to your blog! We are a collection of volunteers and starting a new
    initiative in a community in the same niche. Your blog provided us useful
    information to work on. You have done a extraordinary job!

Leave a Reply

Your email address will not be published. Required fields are marked *