In this article I will explain the process of creating an installer for a Windows Form application using Setup Project
In this article we will create a Setup Project to build an installer of a Windows Application. We will create setup for Windows Application created in my last article.
Create a Setup Project as below and give a name
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
Now File System editor is opened for you. If not the Choose View -> Editor -> File System
Now, you need to add output of your Windows Form Application to build the setup. Right click on Application Folder and select Add -> Project Output
Leave the default selection of Primary Output in the “Add Project Output Group” dialog box and click the OK button. This will add primary output of your with name “Primary output from MultiThreading_BackgroundWorker (Active)” on the right pane of the File System editor.
Right Click on the Primary output and select the first option to create a shortcut on the target machine.
Rename this short cut to “My App”. Repeat this process to create one more shortcut, one for Desktop and one for 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.
Select Setup Project in the Solution Explorer and press F4 to view its properties. You should change 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|
Now we are ready to build our project. Just build the project and installers are ready in the debug folder of the Setup Project. There are two files one is Setup.exe and 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.
Run the installer on the target machine