C# .NET - How to Deploy a Windows desktop Application?

Asked By Jipin M
14-Oct-11 12:30 AM
Hi All,...........

I have been developed a windows desktop application
using visual Studio 2008 ( coded in C# )
How to make this project as a setup package..?
I wish to create a desktop icon while installing the project, and set the default location of project installing is
Program Files/Company Name

Regards...........
  aneesa replied to Jipin M
14-Oct-11 12:39 AM

Create an EXE or Setup File in .NET Windows Application


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.

http://balanagaraj.files.wordpress.com/2007/05/windowslivewritercreateexeorsetupfi.netwindowsapplication-ec19addnew3.png

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.

http://balanagaraj.files.wordpress.com/2007/05/windowslivewritercreateexeorsetupfi.netwindowsapplication-ec19setup5.png

3. New project appear in solution explorer,for eg., you have give the name “MyEXE” file will be displays with given name.

http://balanagaraj.files.wordpress.com/2007/05/windowslivewritercreateexeorsetupfi.netwindowsapplication-ec19image08.png

4.Right click the MyEXE > go View > click “File System”

http://balanagaraj.files.wordpress.com/2007/05/windowslivewritercreateexeorsetupfi.netwindowsapplication-ec19image014.png

5.You can see the “File System on TargetMachine”under  three folders
Application Folder
User’s Desktop
User’s Program Menu

http://balanagaraj.files.wordpress.com/2007/05/windowslivewritercreateexeorsetupfi.netwindowsapplication-ec19image039.png

6.Select Application Folder and right click Add>Project Output>select Primary output

http://balanagaraj.files.wordpress.com/2007/05/windowslivewritercreateexeorsetupfi.netwindowsapplication-ec19image042.png

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

http://balanagaraj.files.wordpress.com/2007/05/windowslivewritercreateexeorsetupfi.netwindowsapplication-ec19image043.png

next >>

http://balanagaraj.files.wordpress.com/2007/05/windowslivewritercreateexeorsetupfi.netwindowsapplication-ec19image048.png

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

http://balanagaraj.files.wordpress.com/2007/05/windowslivewritercreateexeorsetupfi.netwindowsapplication-ec19image044.png

change the properties as per you requirement

9.Finally Build the new project After successfully Build the project myEXE(Setup) will be appear in Application Debug or Release folder(depend upon the properties settings)

http://balanagaraj.files.wordpress.com/2007/05/windowslivewritercreateexeorsetupfi.netwindowsapplication-ec19image053.png

EXE or installer will be available on his physical path…

http://balanagaraj.files.wordpress.com/2007/05/windowslivewritercreateexeorsetupfi.netwindowsapplication-ec19image059.png

When you want to install  the EXE on the client machine, before you should be installed .NET Framework on that machine because, Applications and controls written for the .NET Framework requires the .NET Framework Redistributable Package version to be installed on the computer where the application or control runs.

II. Create shortcut icon  in User’s Desktop and User’s Program Menu

Step1: Select ‘User’s Desktop’ or ‘User’s Program Menu’  and right click on right side pane

http://balanagaraj.files.wordpress.com/2007/05/user-desktop.png

Step 2: Add primary output of actual application and click ‘OK’ to select

http://balanagaraj.files.wordpress.com/2007/05/primary-output.png

Step 3: Rename the actual name to your desired project/product name

http://balanagaraj.files.wordpress.com/2007/05/rename.png

Step 4: Here the sample product name is ‘Your Product Name’ for demo purpose

http://balanagaraj.files.wordpress.com/2007/05/rename-product-name.png

Step 5: If we want to add icon on shortcut, Click Properties Window

http://balanagaraj.files.wordpress.com/2007/05/properties-window.png

Step 6: Select Icon, next Browse icon file

http://balanagaraj.files.wordpress.com/2007/05/icon-in-properties-window.png

Step 7:  Browse Icon File (Format should be .ico, other formats are not acceptable)

http://balanagaraj.files.wordpress.com/2007/05/browse.png

Step 8: Click  ‘Application Folder’

http://balanagaraj.files.wordpress.com/2007/05/application-folder.png

Step 9: Add File button will enable once you have clicked Application Folder

http://balanagaraj.files.wordpress.com/2007/05/add-file.png

Step 10: Select your product icon from somewhere in system and Click ‘OK’

User should follow the same steps for shortcut added to User’s Program Menu.

Install your setup in target machine, You can view the shortcuts in Desktop and Start Menu.

Figure: Shortcut icon in Desktop

http://balanagaraj.files.wordpress.com/2007/05/desktop-shortcut.png

Figure: Shortcut icon in User’s Program Menu

http://balanagaraj.files.wordpress.com/2007/05/user-programs-start-menu.png

III. Add Prerequisites

Prerequisites are provide support resources to run the installed process on your target machine.

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)
  • Download 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

http://balanagaraj.files.wordpress.com/2007/05/prerequisites_properties.png

2. Click the Prerequisites button in Property Pages

http://balanagaraj.files.wordpress.com/2007/05/prerequisites_button.png

3. Select the required prerequisites from the window

http://balanagaraj.files.wordpress.com/2007/05/prerequisites_window.png

Click ‘Ok’, prerequisites will associate based on your install location selection.

  Riley K replied to Jipin M
14-Oct-11 12:41 AM


Follow these steps

Open Visual Studio

Step 1 Create a Setup and Deployment Project

Let's create our new project. Right click on your solution in the Solution Explorer on the right hand side of your Visual Studio IDE and select Add -> New Project. From the list of project types, choose Other Project Types -> Setup and Deployment -> Setup Project.

Step 2 Setup Properties

We would like everyone to know who created this installer. Click on your new Setup and Deployment project in the solutions explorer. Now you will see in the Properties windows (Just below the Solutions Explorer usually), settings for Manufacturer, Author, and Title. Fill these in as appropriate.

Step 3 Add Project Output & Content

We want to include our project .exe and all required content files. Right click on your Setup and Deployment project in the Solution Explorer and choose View -> File System. Right click on the Application Folder node and choose Add -> Project Output. Choose Primary Output, this will include your .exe. Repeat this step and choose Content Files if your project has required content such as images, audio, etc.

Step 4 Create Shortcuts

Another requirement is to include a shortcut to our application. Fortunately this is quite simple. With the Setup and Deployment File System tab still open, right click in the right hand pane to bring up a context menu. Choose Create New Shortcut. From this dialogue, navigate into the Application Folder, and choose Primary Output from "Project name" (Active). This will point the shortcut to your .exe. Click OK to accept this selection.

Refer this links

http://support.microsoft.com/kb/307353

http://msdn.microsoft.com/en-us/library/996a3fxs.aspx?s=16


Regards

  Vickey F replied to Jipin M
14-Oct-11 12:42 AM

Visual Studio 2005 Setup and deployment Projects provides to make an exe 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.

Builds an installer for a Windows-based application.

3)Web Setup Project : Builds an installer for a Web application.

Builds an installer for a Web application.

4)Cab Project : Creates a cabinet file for downloading to a legacy Web browser.

Creates a cabinet file for downloading to a legacy Web browser.

5)Smart Device Cab Project : Creates a Cab project to deploy device applications.

Creates a Cab project to deploy device applications.

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.

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.

4. Right click the MyEXE > go View > click "File System"

5. You can see the "File System on TargetMachine"under three folders

Application Folder

User’s Desktop
User’s Program Menu

6. Select Application Folder and right click Add>Project Output>select Primary output

7. Select User’s Desktop richt click on the second window>click create new shortcut>select output file from Application folder>change the file name from primary output name to MyEXE

8. If you want to change the Manufactures name f,just right click the project go to properties

change the properties as per you requirement

9. Finally Build the new project After successfully Build the project myEXE(Setup) will be appear in Application Debug or Release folder(depend upon the properties settings)

EXE or installer will be available on his physical path…

for more detail follow this

http://balanagaraj.wordpress.com/2007/05/29/create-exe-or-setup-file-in-net-windows-application/

Hope this will help you.

  smr replied to Jipin M
14-Oct-11 12:48 AM
hi

follow this

To add the Windows-based application to the installer

  1. Select the My Notepad Installer project in Solution Explorer. In the File System Editor, right-click the Application Folder node.

  2. On the Project menu, point to Add, and then click Project Output.

  3. In the Add Project Output Group dialog box, select My Notepad from the Project list.

  4. Select the Primary Output group from the list. In the Configuration box, select (Active). Click OK to close the dialog box.

  5. On the Build menu, click Build My Notepad Installer.

To deploy the application (basic installer)

Select the My Notepad Installer project in Solution Explorer. On the Project menu, click Install.

This will run the installer (Setup Wizard) and install My Notepad on your development computer.

follow http://msdn.microsoft.com/en-us/library/k3bb4tfd.aspx

  Sree K replied to Jipin M
14-Oct-11 12:48 AM

This document is specific to deploying AVR for Visual Studio 2005 Windows applications, not AVR for Visual Studio 2005 Web applications.  For information on deploying Web applications, please refer to "Deploying Web Applications".

Preparation

Currently, Visual RPG for .NET Windows deployment is supported on Windows XP Professional, Windows 2000 (Professional and Server), Windows Server 2003, and Windows NT 4.0 Service Pack 6a operating systems.

There are four steps to prepare for when deploying.

1.     http://devnet.asna.com/documentation/Installation_Notes/Deploying_Windows_Apps_81.htm#_1._Application_Setup.

2.     http://devnet.asna.com/documentation/Installation_Notes/Deploying_Windows_Apps_81.htm#_2._Microsoft_.NET.

3.     http://devnet.asna.com/documentation/Installation_Notes/Deploying_Windows_Apps_81.htm#_3._ASNA_AVR.

4.     http://devnet.asna.com/documentation/Installation_Notes/Deploying_Windows_Apps_81.htm#_4.__Application.

 

1. Application Setup

To make deployment of your application easier, you can have Visual Studio 2005 build the application setup for you.  Once your setup is complete, you are ready to follow steps 2 thru 4 to deploy your AVR for Visual Studio 2005 Windows application.

1.     In Visual Studio 2005, start a New Setup and Deployment Project:

2.     Be sure to select "Setup Project".  Enter the Project name and location. Click OK to create the deployment solution.  You will see the following screen.

3.     Add the project you wish to deploy.  Right-click on the Solution ‘setup’ in the Solution Explorer and select Add - -  Existing Project (as shown below). 

4.     Navigate to your application’s folder, and select the application's "vrproj" file – then click Open.

5.     The deployment solution will now reflect your project.

 

6.     Now add the output from your application by right clicking on the application folder in the File System tab as shown:

7.     In the “Add Project Output Group” dialog that appears, choose the ‘Built’ option from your project, and Click OK.   (Note: if there are no such options for your application, you have not “built”, or “compiled” your project.  You will have to “build” your application before you can proceed).

8.     Now you can add any other files that the end user will need in the necessary folder(s).  

For instance, if you have a DLL that needs to go into the System Folder, right-click on the File System on Target machine, click on Add Special Folder - - System Folder as shown.  An option titled “System Folder” will now appear as a deployment option.

Adding a DLL will also add any dependency files it may need.  Be sure to set the properties of any DLLs that need to be registered by the operating system.  Right-click on a DLL name and refer to the Register property to set this option.

Similarly, you can also add files and folders to the Common Files folder, Fonts folder, Program Files folder, System Folder, User Application Data Folder, Desktop, Favorites folder, Personal Data folder, and several other options.  

9.     Once you have all of your solution files correctly configured, click on Build - - Build Solution. 

10.   Your installation files will be created in the path specified by your setup project properties.  Copy these files to the appropriate media.  You are now ready to begin deploying your application.

 

 

2. Microsoft .NET Framework Redistributable

The latest version of the Microsoft .NET framework must exist on the target machine prior to your installation.  If it is already installed on the target machine, you can bypass this step. 

You can confirm that the .NET framework exists on a machine by going to the Add/Remove programs screen from the control panel. 

If Microsoft .NET framework does not appear, you can get the .NET framework from Microsoft.  Use this link for information on downloading the .NET framework re-distributable and/or ordering a CD from Microsoft. http://msdn.microsoft.com/netframework/downloads/howtoget.aspx

Once the .NET framework is installed, the AVR for Visual Studio 2005 Windows Deployment installation can be run on the machine.  

 

3. ASNA AVR for Visual Studio 2005 Distributable

The installation can be installed from the ASNA Product Installation CD, or from http://devnet.asna.com.

To Install from ASNA .NET Product Suite CD

1.   Insert the ASNA .NET Product Suite CD into your CD drive.

·  If your CD drive has AutoPlay, a screen will automatically appear. 

·  If you do not have AutoPlay installed on your CD drive, start Microsoft Windows and from the Start Menu, select Run, and enter the path:  E:\INSTALL.EXE, where ‘E’ is the CD-Rom drive.  Then select the options below to install Windows Deployment 8.1.

2.  Click on the Product Menu button in the lower left corner.

3.  Click on ASNA for .NET Windows Deployment.

4.  Click on Install Windows Deployment 8.1.

5.     The Welcome dialog will display.  Select Next > to continue.

6.     TheLicense Agreement dialog will display.  Click on “I accept the terms of the license agreement” and select the Next> button (which will be available after you click the “I accept….” option).

7.    The Customer Information dialog will display.  Enter your computer’s user name and company name will display.  You can change either as desired.

8.     When finished, press Next > to continue.

9.     Select the desired setup type.  Complete is recommended, but requires the most disk space.  Select Next > to continue.

To review any of the previous settings, select < Back.

10.   At this point, ASNA for .NET Windows Deployment 8.1 is ready to be installed.  Select Install to continue.

The installation process will begin, and the component being installed will display in the title bar.  When the installation has completed, the final dialog will display.

Select Yes to restart your computer now, or No to restart later. 

11.   Select the Finish button to continue. 

The installation is now complete.  Select Finish to close the installation.

 

  dipa ahuja replied to Jipin M
14-Oct-11 03:56 AM
Untitled document
Create new setup project.  You will find 3 folders:
1.    Application Folder
2.    User's desktop
3.    User's program menu
 
Add the exe, database, images, dll files of you project in the "Application Folder"
 
Add the exe file in the "User's Desktop" and "User's program Menu" folder if you want a exe 's short cut in the desktop and in start menu
 
Now all files are added now build the project, and you will get the exe setup file of your in the bin directory of your setup project
 
Create New Account
help
trying to install Security Update for Windows XP (KB890859) in conjunction with Security Update for Microsoft .NET Framework, Version 1.1 Service Pack 1 (KB928366), my update history says that SP1 was installed automatic update wants me to install it again the next time around. Windows Update Discussions Microsoft.DDPatch.PatchInstallation.Install (1) Microsoft.WindowsInstaller.Installer.PatchInfo (1) Windows XP (1) LastPatchedProductName (1) CompleteShadowLaunch (1) CleanupShadowLaunch (1) PrepareShadowLaunch (1 1 2007-10-08 13:51:56:609 1028 91c Agent * Title = Security Update for Microsoft .NET Framework, Version 1.1 Service Pack 1 (KB928366) 2007-10-08 13:51:56:609 1028
on Windows XP Prof Windows 7 I had the following products installed on my PC: Microsoft .NET Framework 1.1 Microsoft .NET Framework 1.1 Hotfix (KB886903) Microsoft .NET Framework 2.0 Microsoft .NET Framework 3.0 This is for Microsoft Support Team: To
Microsoft .Net Framework Windows 7 I have installed - Microsoft .Net Framework 1.1 Microsoft .Net Framework 2.0 Service Pack 2 Microsoft .Net Framework 3.0 Service Pack 2 Microsoft
Add / Remove Programs, NET Framework Windows 7 In 'Add Remove Programs', I have the following: Microsoft .NET Framework 1.1 Microsoft .NET Framework 1.1 Hotfix (KB886903) Microsoft .NET Framework 1.1 Hotfix (KB925168) Microsoft .NET Framework 2
ANN: .NET Framework 3.5 Family Update .NET Framework Microsoft .NET Framework 3.5 Family Update The Microsoft .NET Framework 3.5 Family Update provides compatibility roll-up updates for customer reported issues