Reader Level:
Articles

How to Create an Installer For a WinForm Application Using Setup Project

By Deepak Sharma on March 14, 2012
In this article I will explain the process of creating an installer for a Windows Forms application using Setup Project
  • 3
  • 0
  • 35256
Download Files:
 

In this article I will explain the process of creating an installer for a Windows Forms application using Setup Project.

Introduction

In this article we will create a Setup Project to build an installer of a Windows Application. We will create a setup for the Windows Application created in my last article.

Step 1:

Create a Setup Project as below and give it a name:

WinIns1.gif

Step 2:

Add the Windows Forms Application project for which you want to create the installer. I will add the application created in my last article.

Choose: File -> Add -> Existing Project and select your project

Step 3:

Now the File System editor is opened for you. If not then Choose View -> Editor -> File System.

Now, you need to add output of your Windows Form Application to build the setup. Right-click on the Application Folder and select Add -> Project Output.

WinIns2.gif

Leave the default selection of Primary Output in the "Add Project Output Group" dialog box and click the OK button. This will add the primary output of your setup with the name "Primary output from MultiThreading_BackgroundWorker (Active)" on the right pane of the File System editor.

Step 4:

Right-click on the Primary output and select the first option to create a shortcut on the target machine.

WinIns3.gif

Rename this shortcut to "My App". Repeat this process to create one more shortcut, one for the Desktop and one for the Programs Menu of the target machine. Drag one shortcut in the "User's Desktop" folder and one in the "User's Programs Menu" folder on the left pane of the File System editor.

You can display an icon for the shortcuts by specifying their Icon property.

Step 5:

Select Setup Project in the Solution Explorer and press F4 to view its properties. You should change the following properties:

 

Author

Give your name as you are the author

Manufacture

Application on the target machine will be installed under this value in the Program Files

RemovePreviousVersions

Change it to True if you want to remove previous version of this application installed on the target machine

Version

Give a version to your installer

Step 6:

Now we are ready to build our project. Just build the project and the installers are ready in the debug folder of the Setup Project. There are two files; one is Setup.exe and the other is ProjectName.msi. Copy both files on the target machine and run any of the two to install the Windows Application on the target machine.

Note: As we have developed our application in .Net Framework 3.5, this framework needs to be installed on the target machine.

Step 7:

Run the installer on the target machine:

WinIns4.gif

Article Extensions
Contents added by Scripcariu Adrian on Aug 16, 2012
Hello,

I want to create a Visual Studio 2010 installer in Romanian lanaguage but I don't know how to do that.

I've created in `C:\ProgramFiles\MsVS10.0\Common7\Tools\Deployment\VsdDialogs` a new folder `1048` for Romanian language and I've modified some string with `Orca`.

Then I tried to modify the registry:
`HKEY_CURRENT_USER\SOFTWEARE\Microsoft\VisualStudio\10.0_Config\Deployment\DialogTemplates`

And put `Languages-> Romanian`, `Identifiers 1048` and `CodePages 1250`.

Now Romanian language appears in the drop down in `VS2010->Setup->Localization` but I can't select it.

What to do?

Or any other solution on how to create a VS2010 installer in a language that is not present in the Setup->Localization.

 Many thanks.
Deepak Sharma

Deepak is a Software Developer with over 4 years of experience. His expertise is in Windows Forms, ASP.NET, WPF, SQL Server and MySql.Twitter : @idpkshrBlog : http://deepak-sharma.net

Personal Blog: http://deepak-sharma.net
COMMENT USING

Trending up