Chapter 13. Deploying a Windows Application

OBJECTIVES

This chapter covers the following Microsoft-specified objectives for the “Deploying a Windows-Based Application” section of Exam 70-316, “Developing and Implementing Windows-Based Applications with Microsoft Visual C# .NET and Microsoft Visual Studio .NET”:

Deploy a Windows-based application.

  • Use setup and deployment projects.

  • Microsoft Visual C# .NET ships with a new project category, Setup and Deployment projects. These projects contain templates that help in building user-friendly installation packages for different types of applications. This objective requires you to know how to create various setup projects that help in deploying Windows applications.

Create a setup program that installs an application and allows for the application to be uninstalled.

  • Register components and assemblies.

  • Perform an install-time compilation of a Windows-based application.

  • Visual Studio .NET creates installation packages based on the Microsoft Windows Installer technology. Microsoft Windows Installer 2.0 handles the execution of tasks involved in installing, uninstalling, and repairing Windows applications. You only have to focus on what files need to be installed, where they should be located, what Registry entries need to be made, what type of user interface needs to be displayed to the end user, and whether any condition is to be checked or custom action to be performed during the installation process. This objective requires you to know how to deploy components and assemblies and also how to perform native compilation (that is, compiling .NET assemblies to processor-specific native code) of the assemblies at the time of installation.

Add assemblies to the global assembly cache.

  • The .NET Framework allows you to place shared assemblies (assemblies intended to be used by more than one application) in a central location called the global assembly cache (GAC). The assemblies that are placed in the GAC must have strong names. This objective requires you to know how to assign a strong name to an assembly and install files in the GAC on the target machine during deployment.

Plan the deployment of a Windows-based application.

  • Plan a deployment that uses removable media.

  • Plan a Web-based deployment.

  • Plan a network-based deployment.

  • Ensure that the application conforms to Windows Installer requirements and Windows Logo Program requirements.

  • This objective requires you to know the various techniques by which you can deploy applications. You can choose to deploy them through removable media such as floppy disks, CDs, or DVDs; you can use a network-based deployment; or you can make your installation package available over the Web, so that the end user can download the package.

    This objective also requires you to know what is involved in creating applications that conform to the Windows Installer and Windows Logo Program requirements.

Verify security policies for a deployed application.

  • Launch a remote application (URL remoting).

  • You can deploy a Windows application on a network server or a Web server. This deployment method does not require you to install the application on each desktop that will use it. At runtime users can launch the application by typing the uniform resource locator (URL) in Internet Explorer. All necessary files are then downloaded to the user's computer and can be executed from there. This deployment method is called zero deployment because no installation is required on client machines. However, security is a concern with code downloaded from the Internet. This objective also requires you to know how to configure a security policy for the target machine in order to allow good code while restricting bad code from executing on the user's computer.

OUTLINE

Introduction 839

Deployment Tools 839

XCOPY Deployment 840

Microsoft Windows Installer 841

Deploying a Windows Application 842

Creating a Setup Project 846

Customizing a Setup Project 853

Using the File System Editor 853

Using the Registry Editor 857

Using the File Types Editor 858

Using the User Interface Editor 860

Using the Custom Actions Editor 861

Using the Launch Conditions Editor 864

Shared Assemblies 868

Assigning a Strong Name to an Assembly 869

Adding an Assembly to the GAC 873

Using Windows Installer to Add an Assembly to the GAC 873

Using Windows Explorer to Add an Assembly to the GAC 873

Using the .NET Framework Configuration Tool to Add an Assembly to the GAC 874

Using the Global Assembly Cache Tool (gacutil.exe) to Add an Assembly to the GAC 876

Referencing an Assembly from the GAC 877

How the CLR Locates Assemblies 880

Delay Signing an Assembly 882

Delay Signing Using the Assembly Linker Tool 883

Creating a Merge Module Project 884

Creating Installation Components 890

Understanding the Installer Class 891

Working with Predefined Installation Components 892

Deploying an Assembly That Contains the Installation Components 894

Deploying an Installation Component by Using the Setup Project 895

Deploying an Installation Component by Using the Installer Tool (installutil.exe) 896

Working with Installer Classes 896

Performing Install-Time Compilation 897

URL Remoting 902

Launching a Remote Application 903

The Download Cache 904

Code Access Security Policy 905

Calling Assemblies from the Partially Trusted Code (AllowPartiallyTrusted CallersAttribute Class) 908

Setting the Runtime Security Policy for an Assembly 910

Setting Runtime Security Policy for a Zone 913

Methods of Deployment 915

Deployment via Removable Media 915

Network-Based Deployment 917

Administrative Installation 917

Web-Based Deployment 918

Windows Logo Program Requirements 919

The Certified for Microsoft Windows Logo Program 920

The Designed for Microsoft Windows XP Logo Program 923

The Microsoft .NET Connected Logo Program 924

Chapter Summary 925

Apply Your Knowledge 927

STUDY STRATEGIES

  • Review the “Deployment Concepts” and “Deploying Applications” sections of the Visual Studio .NET Combined Help Collection.

  • Experiment with using setup projects and merge module projects to deploy Windows applications. Understand when you should choose to create a setup project versus a merge module project.

  • Work with the different editors that are available in setup and merge module projects and thoroughly understand the purpose of each of these editors.

  • Experiment with the Strong Name tool (sn.exe) to create a public/private key pair and then use the key pair to assign a strong name to an assembly. Work with the delay-signing feature and understand the scenarios in which it can be helpful.

  • Experiment with placing assemblies in the GAC. Understand the steps performed by the runtime to locate assemblies.

  • Experiment with creating custom actions to compile assemblies into machine-specific code at install time.

  • Understand the runtime security policy and how you can use it to your advantage to allow useful applications to run while blocking malicious code.

  • Understand the various ways to deploy a Windows application and their benefits and shortcomings. Understand when to use XCOPY deployment versus Windows Installer deployment.

  • Understand the requirements of the Windows Logo Program.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.119.123.252