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:
- Go to Other Project Types -> Setup and Deployment -> Visual Studio Installer and select Setup Project as shown below:
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)
- You will see the New Window to add Project Output. Select the Project Scanner and Select Primary Output.
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)
We can also set the icon for the application by going to the properties of that shortcut.
- Click on Icon -> Browse
- 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:
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.
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#
- How To Create Setup file Visual Studio C#.NET Project - September 20, 2016
- How to Create a Simple ASP.NET Website-Master Pages - September 16, 2016
- Retrieve Code C# in Visual Studio 2010 - September 15, 2016
- ASP.NET Validation for a Website-Tutorial - August 31, 2016
- Insert Code C# from Visual Studio into SQL - August 26, 2016
- How to add Splash Screen to Windows App in VS10 C# - August 20, 2016