Top Banner
Visual Studio ® 2008: Windows ® Presentation Foundation
26
Welcome message from author
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
Page 1: 6460A_09

Visual Studio® 2008: Windows® Presentation

Foundation

Page 2: 6460A_09

Module 9: Configuring and Deploying Applications in Windows Presentation Foundation

• Deployment Options

• Deploying a Stand-Alone WPF Application

• Deploying an XBAP Application

• Configuring Manifest Settings

Page 3: 6460A_09

Lesson: Deployment Options

• Deployment Technologies

• Full-Trust and Partial-Trust Applications

• WPF Features Available in Partial Trust

• WPF Features Unavailable in Partial Trust

• XBAP Applications on the Local Intranet

Page 4: 6460A_09

Deployment Technologies

• XCopy deployment

• Microsoft Windows Installer

• ClickOnce deployment

• Windows Remote Desktop Connection

Page 5: 6460A_09

Full-Trust and Partial-Trust Applications

RegistryRegistry

WPFApplication

WPFApplication

DNS DatabaseDNS Database

Web ServicesWeb Services

Environment Variables

Environment Variables

SQL ServerSQL Server

OLEDB Data Source

OLEDB Data Source

File SystemFile System

Windows Event Log

Windows Event Log

Unmanaged CodeUnmanaged Code

EnvironmentPermissionEnvironmentPermission

Remote ServersRemote Servers

SecurityPermission.UnmanagedCode

SecurityPermission.UnmanagedCode

WebPermissionWebPermission

DNSPermissionDNSPermission

RegistryPermissionRegistryPermission

SqlClientPermissionSqlClientPermission

SocketsPermissionSocketsPermission

FileIOPermissionFileIOPermission

OleDbClientPermissionOleDbClientPermissionEventLogPermissionEventLogPermission

Page 6: 6460A_09

WPF Features Available in Partial Trust

• General features

Browser window, isolated storage, commands, and simulated drag and drop

• Web integration

Browser download dialog box, top-level navigation, HTTP Web requests, E-mail links, and ASMX Web services

• Visual effects

2-D and 3-D graphics, animation, media, audio, and video

• Reading

Flow documents, XPS documents, embedded fonts, system fonts, and TrueType fonts

• Editing

Spelling checker and copy and paste

Page 7: 6460A_09

WPF Features Unavailable in Partial Trust

• General features

Application-defined windows and dialog boxes, file system access, registry access, and Windows Forms interoperability

• Web integration

Scripting and access to the Document Object Model

• Visual effects

Bitmap effects and image encoding

• Editing

Access to the Rich Text Format (RTF) clipboard and full XAML support

Page 8: 6460A_09

XBAP Applications on the Local Intranet

By default, XBAP applications run with partial trust:

• Default Internet zone permission set

If you launch an XBAP application from the local intranet:

• The XBAP application can take advantage of the LocalIntranet permission set

LocalIntranet permissions grant access to additional resources:

• DNS

• Environment variables

• File dialogs

• Isolated storage

• Printing

• Reflection

• Security

• User interface

Page 9: 6460A_09

Lesson:Deploying a Stand-Alone WPF Application

• Deploying a Stand-Alone Application by Using Windows Installer

• Deploying a Stand-Alone Application by Using ClickOnce

• Installing the .NET Framework

Page 10: 6460A_09

Deploying a Stand-Alone Application by Using Windows Installer

To create a Windows Installer Setup project:

1. Add a Setup project to your solution

2. Configure your application as an output project

3. Configure the properties of the setup project

4. Add any additional files

5. Build the project

6. Distribute the .msi file

Page 11: 6460A_09

Deploying a Stand-Alone Application by Using ClickOnce

To create a ClickOnce deployment:

1. Select the project that you want to deploy

2. On the Build menu, click Publish

3. Follow the steps in the Publish Wizard

4. Distribute the published location

Page 12: 6460A_09

Installing the .NET Framework

To run a WPF application, the Microsoft .NET Framework 3.0 must be installed on the client computer

For WPF browser-hosted applications launched from Windows Internet Explorer 7:

• If .NET Framework is installed, Internet Explorer detects it

• If .NET Framework is not installed, Internet Explorer downloads it and installs it

Page 13: 6460A_09

Lesson: Deploying an XBAP Application

• XBAP Files That Must Be Deployed

• What Is a Manifest File?

• Publishing an XBAP Application to a Web Server

• Installing an XBAP Application to a Client Computer

Page 14: 6460A_09

XBAP Files That Must Be Deployed

An XBAP is a compiled application that requires at least the following three files to be deployed:

• ApplicationName.exe

• ApplicationName.xbap

• ApplicationName.exe.manifest

Page 15: 6460A_09

What Is a Manifest File?

An application manifest file describes:

• Application assemblies

• Dependent assemblies

• Permissions that are required by the application

A deployment manifest file describes the deployment model:

• Location

• Current version

• Update behavior

• Publisher identity

• Digital signature

Page 16: 6460A_09

Publishing an XBAP Application to a Web Server

To deploy an XBAP by using ClickOnce deployment:

1. Select the project you want to deploy

2. On the Build menu, click Publish

3. Follow the steps in the Publish Wizard

4. Distribute the published location

To deploy an XBAP by using XCopy deployment:

1. Build the application

2. Copy the output files to the target Web server

Page 17: 6460A_09

Installing an XBAP Application to a Client Computer

To deploy an XBAP by using XCopy deployment:

1. Build the application

2. Copy the output files to the target client computer

To deploy an XBAP by using Windows Installer:

1. Add a Setup project to your solution

2. Configure your application as an output project

3. Configure the properties of the Setup project

4. Add any additional files

5. Build the project and distribute the .msi file

Page 18: 6460A_09

Lesson: Configuring Manifest Settings

• Using the Manifest Generation and Editing Tools

• Mage.exe Commands

• Setting Options for New and Updated Files

• Setting Options for Signing Files

Page 19: 6460A_09

Using the Manifest Generation and Editing Tools

You can use the manifest generation and editing tools to create and edit manifest files

• Mage.exe is a command-line tool

• MageUI.exe is an equivalent graphical tool

You can use Mage.exe and MageUI.exe to set:

• Common properties in deployment and application manifests

• Application manifest properties

• Deployment manifest properties

Page 20: 6460A_09

Mage.exe Commands

• -New

Create a new deployment or application manifest file

• -Update

Make changes to a manifest file

• -Sign

Sign a manifest file by using a certificate

• -Help

Describes all the available commands and their options

Mage.exe syntax:

Mage [commands] [commandOptions]Mage [commands] [commandOptions]

Page 21: 6460A_09

Setting Options for New and Updated Files

Common options for new and updated application and deployment manifest files:

• CertFile and CertHash

• Name and Password

• ToFile, Processor, and Version

Options for new and updated application manifest files:

• FromDirectory

• TrustLevel

Options for new and updated deployment manifest files:

• AppCodeBase and AppManifest

• Install, MinVersion, and ProviderUrl

Page 22: 6460A_09

Setting Options for Signing Files

Specify the following options when you sign a manifest file:

• CertFile and CertHash

• Password

• ToFile

Page 23: 6460A_09

Lab: Configuring and Deploying WPF Applications

• Exercise 1: Deploying a Stand-Alone WPF Application

• Exercise 2: Updating a Deployment Manifest

• Exercise 3: Deploying an XBAP Application

Logon information

Virtual machine 6460A-LON-DEV-09

User name Student

Password Pa$$w0rd

Estimated time: 60 minutes

Page 24: 6460A_09

Lab Review

• What type of project must you create to deploy a stand-alone application by using Windows Installer?

• What is the name of the tool that you use to create and manipulate both deployment and application manifest files?

• What three files are the minimum that is required to manually deploy an XBAP?

• What is the name of the technology that is used to publish XBAP applications when using Visual Studio?

Page 25: 6460A_09

Module Review and Takeaways

• Review Questions

• Best Practices

• Tools

Page 26: 6460A_09

Course Evaluation