Create Setup and Deployment Project Visual Studio 2008 Posted by VIJI Monday, March 1, 2010 Creating a Setup and Deployment Project In this article I will cover the basics of creating a Windows Installer. This article will explain the step by step process of creating a Setup Project. Step 1: Create a Sample .Net Project. I have named this project as "TestBlogProject". Figure 1 Sample Project Create a Setup Project Open the TestBlogProject in the VS IDE.
36
Embed
Create Setup and Deployment Project Visual Studio 2008
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Create Setup and Deployment Project Visual Studio 2008 Posted by VIJI Monday, March 1, 2010
Creating a Setup and Deployment ProjectIn this article I will cover the basics of creating a Windows Installer. This article will explain the step by step process of creating a Setup Project.
Step 1: Create a Sample .Net Project. I have named this project as "TestBlogProject".
Figure 1 Sample Project
Create a Setup ProjectOpen the TestBlogProject in the VS IDE.
There are five different templates that are available when you select the project type 'Setup and Deployment Projects'.
1. Setup Project: Creates a Windows Installer project to which files can be added. This project type is the most generic of the five.
2. Web Setup Project: Creates a Windows Installer web project to which files can be added.
3. Merge Module Project: Creates a Windows Installer Merge Module project to which files can be added. This project type is most commonly used for using third party products.
4. Setup Wizard: Creates a Windows Installer project with the aid of a wizard. 5. Cab Project: Creates a Cab project to which files can be added.
For the purpose of this article, I will be using the template Setup Project. Provide a name for the project as well choose the location where this project will be established. (See Figure 3) Once you have done this click 'OK' and you should now see a screen like the following.
File System EditorThe File System (Figure 6) provides you the essential tools to work with the application folder, user's desktop, and the user's programs menu.
Figure 6: File System Editor
The first thing we want to do here is to include the relevant files and folders we wish to install on the user's machine. This is accomplished by right clicking the Application Folder and selecting 'Add'. The following screenshot is an example of something similar you may see.
Figure 7: Add Project Output
Now to add project output files to this folder, Click Project Output.
Merely add one or more of the files that is vital for your application by clicking on File…. Now that you have you files in place.
Figure 8: Project Output
We could take additional steps such as manipulating the user's desktop with items such as a shortcut, as well you can add a program group to the user's program group.
Name the shortcut as you want. I have given the name as TestBlog. Drag and drop to User's Desktop Folder
Figure 9: Desktop Shortcut to application
The next item you find of immense importance is the User Interface Editor. Inside of this editor you may eliminate or include dialogs that are needed for this install project. The following screenshot is the default User Interface that is created when I initially created this setup project (See Figure 10). The only variation is that I have added a Customer Information dialog.
Figure 10: User Interface EditorTo include the Customer Information dialog that I spoke of follow the following steps.
1. Select the Customer Information Dialog and click 'OK'
As you can see there are is an ample variety of dialogs you can choose from.
Prerequisites Installation in Windows InstallerMost applications have prerequisites: Components such as the .NET Framework runtime must be available on a target computer in order for the application to run. The deployment tools in Visual Studio include the capability to automatically detect the existence of components during installation and install a predetermined set of prerequisites — a process known as bootstrapping.
This will be achieved as follows:
To choose which prerequisites to install
1. In Solution Explorer, select the deployment project and Right Click
2. Click Properties.
3. In the Property Pages dialog box, expand the Configuration Properties node, and then select the Build property page.
4. Click the Prerequisites button.
5. In the Prerequisites dialog box, make sure that the Create setup program to install prerequisite components box is checked.
6. In the Choose which prerequisites to install list, check the prerequisites that you wish to install, and then click OK.
To specify the download location for prerequisites
In Solution Explorer, select the deployment project, right click. Click Properties. In the Property Pages dialog box, expand the Configuration Properties node, and then select the Build
property page. Click the Prerequisites button.
In the Prerequisites dialog box, choose a location:
o If you want to deploy the installers for the prerequisites to a vendor, click Download prerequisites from the component vendor's web site.
o If you want to deploy the installers for the prerequisites to the same location as your application installer, click Download prerequisites from the same location as my application.
o If you want to deploy the installers for the prerequisites to a different location, click Download prerequisites from the following location and enter a local path, URL, or file-share location.
Steps to Create Setup and Deployment Project in Dot Net VS 2008Posted by praveen on July 10th, 2009 | 78 Comments
Step 1Create your own windows application. Create a new Windows application project in C# and named it as Sample.
Step 2
Design your own application. Here we have a simple login form for example.
Step 3After completing the design and coding, build the solution of the project in release mode.
Step 4Check the Release folder for the file “ProjectName.exe”. Here in this example we have the project name as sample so we can find a file with the name Sample.exe. Double click the executable file and check the example.
Step 5Create a Deployment Project. Select the “Other Project Types” -> “Setup and Deployment” -> “Setup project”. Here we have the setup project for example as “SampleSetup”.
Step 6Add the Sample.exe project application file inside the “Application Folder”.
Step 7
To make a shortcut for the project right click “File System on Target Machine” and create shortcut of the application. Here in this example the project shortcut is created in program files folder.
Step 8Create the shortcut of the application.
Step 9Rename the shortcut of the application.
Step 10Move the Shortcut file to specified target. Note if you need another shortcut for some other target also create use same steps.
Step 11Now build the solution in release mode.
Step 12The setup file created in release folder of the project specified path.
Step 13Run the setup, step the path to extract.
Step 14The SampleSetup project is extracted and shortcuts are created. Now run your application.
Create an EXE or Setup File in .NET Windows Application
Hi .NET Architects!
Visual Studio Setup and deployment Projects provides to make an executable or installer file in .NET windows application is easy and rapidly.
Visual Studio provides templates for four types of deployment projects: Merge Module Project, Setup Project, Web Setup Project, and Cab Project. In addition, a Setup wizard is provided to help step you through the process of creating deployment projects. You can see the templates and the wizard in the New Project dialog box under the Setup and Deployment Projects node.
The following are guidelines for choosing the right type of deployment project for your project.
1)Merge Module Project : Packages components that might be shared by multiple applications.
2)Setup Project : Builds an installer for a Windows-based application.
3)Web Setup Project : Builds an installer for a Web application.
4)Cab Project : Creates a cabinet file for downloading to a legacy Web browser.
5)Smart Device Cab Project : Creates a Cab project to deploy device applications.
This topic demonstrates deployment using a Setup and Deployment Project.
Setup Projects
Setup projects allow you to create installers in order to distribute an application. The resulting Windows Installer (.msi) file contains the application, any dependent files, information about the application such as registry entries, and instructions for installation. When the .msi file is distributed and run on another computer, you can be assured that everything necessary for installation is included; if for any reason the installation fails (for example, the target computer does not have the required operating system version), the installation will be rolled back and the computer returned to its pre installation state.
I. Create Setup Project
The following steps will gives the elegant guidance to create an executable or installer file.
1. Go to file menu > click Add > new project >now “Add New Project” dialog will appear.
2. Select the “Other Project Types” and click “Setup and Deployment” projects,Choose “Setup Project” give name project name in name text box finally click OK.
3. New project appear in solution explorer,for eg., you have give the name “MyEXE” file will be displays with given name.
7. Select User’s Desktop right click on the right side pane>click create new shortcut>select output file from Application folder>change the file name from primary output name to MyEXE
Next >>
Same procedure follows the user’s program menu also
8.If you want to change the Manufactures name, just right click the project go to properties
Mode 1: Optimization for speed (Installation Speed)
Mode 2: Optimization for size (Setup file size)
13. Once successfully build the setup. Please look up in inside Release folder
When you want to install the setup file or exe file on the client machine, before you should be installed .NET Framework on that machine because, Applications and controls written for the .NET Framework v2.0 requires the .NET Framework Redistributable Package version 2.0 to be installed on the computer where the application or control runs. (Framework 4.0 need .NET Framework 4 Client Profile).
Visual Setup and Deployment projects are automatically detect the required prerequisites need to install the system. But the question is what is the source for install the prerequisites? No need to worry, Visual Studio IDE provides three options to install the prerequisites on your system.
Download prerequisites from component vendor’s website (default option) D ownload prerequisites from the same location as my application Download prerequisites from the following location
How to add prerequisites in Visual Studio?
1. Select Project in Solution Explorer, Right click
2. Click the Prerequisites button in Property Pages
How do avoid multiple instance in installed application?
In Program.cs file add the below code. static void Main(){Application.EnableVisualStyles();Application.SetCompatibleTextRenderingDefault(false);Process[] process = Process.GetProcessesByName(Application.ProductName); //Prevent multiple instanceif (process.Length > 1){MessageBox.Show("{Application Name} is already running. This instance will now close.", "{Application Name}",MessageBoxButtons.OK, MessageBoxIcon.Information);Application.Exit();}else{Application.Run(new <Initial Form>());}}
Help me to improve better by sharing your feedback here.