Upload
lauren-watkins
View
261
Download
0
Tags:
Embed Size (px)
Citation preview
Module 15
Configuring and Deploying Windows Client Applications
Module Overview
• Deployment Options
• Deploying a Stand-Alone WPF Application
• Deploying an XBAP
• Configuring Security Settings
Lesson 1: Deployment Options
• Deployment Technologies
• Full Trust and Partial Trust Applications
• WPF Features Available in Partial Trust
• WPF Features Unavailable in Partial Trust
• XBAPs on the Local Intranet
• Features and Benefits of the .NET Framework Client Profile
Deployment Technologies
• ClickOnce deployment
• XCopy deployment
• Windows Installer
Full Trust and Partial Trust Applications
RegistryRegistry
WPFApplication
WPFApplication
DNS DatabaseDNS Database
Web ServicesWeb Services
Environment VariablesEnvironment Variables
SQL ServerSQL Server
OLEDB Data SourceOLEDB Data Source
File SystemFile System
Windows Event LogWindows Event Log
Unmanaged CodeUnmanaged Code
EnvironmentPermissionEnvironmentPermission
Remote ServersRemote Servers
SecurityPermission.UnmanagedCodeSecurityPermission.UnmanagedCode
WebPermissionWebPermission
DNSPermissionDNSPermission
RegistryPermissionRegistryPermission
SqlClientPermissionSqlClientPermission
SocketsPermissionSocketsPermission
FileIOPermissionFileIOPermission
OleDbClientPermissionOleDbClientPermissionEventLogPermissionEventLogPermission
WPF Features Available in Partial Trust
General features:General features:
Web integration:Web integration:
Visual effects:Visual effects:
Reading:Reading:
Editing:Editing:
• Spelling checker and copy and paste
• Flow documents, XPS documents, and fonts
• 2-D and 3-D graphics, animation, media, audio, and video
• Browser window, isolated storage, commands, and simulated drag and drop
• Browser download dialog box, top-level navigation, and HTTP Web requests
WPF Features Unavailable in Partial Trust
General features:General features:
• Application-defined windows and dialog boxes, file system access, registry access, and Windows Forms interoperability
Visual effects:Visual effects:
• Bitmap effects and image encoding
Editing:Editing:
• Access to the RTF clipboard and full XAML support
XBAPs on the Local Intranet
By default, XBAPs run with partial trust:By default, XBAPs run with partial trust:
• Default Internet zone permission set
If you launch an XBAP from the local intranet:If you launch an XBAP from the local intranet:
• The XBAP can take advantage of the LocalIntranet permission set
LocalIntranet permissions grant access to additional resources:LocalIntranet permissions grant access to additional resources:
•DNS
•Environment variables
•File dialog boxes
•Isolated storage
•Printing
•Reflection
•Security
•User interface
Features and Benefits of the .NET Framework Client Profile
.NET Framework Client Profile:.NET Framework Client Profile:
• Is a subset of the .NET Framework optimized for client applications
• Enables you to create fast and small installation packages
• Does not require installation of the full version of the .NET Framework on client computers
Features:Features:• CLR
• ClickOnce
• Windows Forms
• WPF and WCF
• Entity Framework
• Windows Workflow Foundation
• Speech
• XSLT support
• LINQ to SQL
• Runtime design libraries
• Managed Extensibility Framework
• Dynamic types
• Parallel programming
• Debugging client applications
Lesson 2: Deploying a Stand-Alone WPF Application
• Deploying a Stand-Alone Application by Using ClickOnce
• Deploying a Stand-Alone Application by Using Windows Installer
• Installing the .NET Framework 4
Deploying a Stand-Alone Application by Using ClickOnce
To create a ClickOnce deployment: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
Deploying a Stand-Alone Application by Using Windows Installer
To create a Windows Installer Setup project: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
Installing the .NET Framework 4
To run a WPF application, the Microsoft .NET Framework 4 must be installed on the client computerTo run a WPF application, the Microsoft .NET Framework 4 must be installed on the client computer
For WPF browser-hosted applications launched from Windows Internet Explorer:For WPF browser-hosted applications launched from Windows Internet Explorer:
• If the .NET Framework is installed, Internet Explorer detects it
• If the .NET Framework is not installed, Internet Explorer downloadsit and installs it
Lesson 3: Deploying an XBAP
• XBAP Files That Must Be Deployed
• Manifest Files
• Publishing an XBAP to a Web Server
• Installing an XBAP on a Client Computer
XBAP Files That Must Be Deployed
An XBAP is a compiled application that requires at least the following three files to 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
Manifest Files
An application manifest file describes:An application manifest file describes:
• Application assemblies
• Dependent assemblies
• Permissions that are required by the application
A deployment manifest file describes:A deployment manifest file describes:
• Location
• Current version
• Update behavior
• Publisher identity
• Digital signature
Publishing an XBAP to a Web Server
To deploy an XBAP by using ClickOnce deployment:To deploy an XBAP by using 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
To deploy an XBAP by using XCopy deployment:To deploy an XBAP by using XCopy deployment:
1. Build the application
2. Copy the output files to the target Web server
Installing an XBAP on a Client Computer
To deploy an XBAP by using XCopy deployment: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: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
Lesson 4: Configuring Security Settings
• Manifest Generation and Editing Tools
• Using Mage.exe
• Using MageUI.exe
• Setting Properties for Application Manifests
• Setting Properties for Deployment Manifests
• Setting Properties for Application and Deployment Manifests
• Setting Signing Properties for Application and Deployment Manifests
Manifest Generation and Editing Tools
You can use the Manifest Generation and Editing tools to create and edit manifest files:You can use the Manifest Generation and Editing tools to create and edit manifest files:
You can use Mage.exe and MageUI.exe to set:You can use Mage.exe and MageUI.exe to set:
• Mage.exe is a command-line tool
• MageUI.exe is an equivalent graphical tool
• Common properties in deployment and application manifests
• Application manifest properties
• Deployment manifest properties
• -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
• List all of the available commands and their options
Using Mage.exe
Mage.exe syntaxMage.exe syntax
Mage [commands] [commandOptions]Mage [commands] [commandOptions]
Using MageUI.exe
Setting Properties for Application Manifests
• -FromDirectory directoryPath
• Populates the application manifest with descriptions of all assemblies and files found in the directory path. Also creates a hash for each file to check that no tampering happens
• When used with the –Update command, removes files that no longer exist in the directory
• -IconFile filePath
• Specifies the full path to the icon file
• -TrustLevel level
• Specifies the level of trust to grant to the application on client computers
• -UseManifestForTrust willUseForTrust
• Specifies whether the signature of the manifest will be used for making trust decisions on the client
Setting Properties for Deployment Manifests• -AppCodeBase manifestReference
• Inserts a URL or file path to the application manifest
• -AppManifest manifestPath
• Inserts a reference to a deployment’s application manifest
• -IncludeProviderURL url
• Indicates whether to include the update location
• -Install willInstall
• Indicates whether to install on the local computer or run from the Web
• -MinVersion [version]
• Specifies the minimum version of the application that a user can run
• -ProviderURL url
• Specifies the location to examine for application updates
Setting Properties for Application and Deployment Manifests
• -Name nameString
• Signifies the name used to identify the application
• -Publisher publisherName
• Adds the publisher name to the description element of the manifest
• -SupportURL uri
• Specifies the link to appear in Add or Remove Programs
• -ToFile filePath
• Specifies the output path of the file that has been created or modified
• -Version versionNumber
• Signifies the version of the deployment
Setting Signing Properties for Application and Deployment Manifests
• -CertFile filePath
• Specifies the location of an S509 digital certificate for signing the manifest
• -CertHash hashSignature
• Signifies the hash of a digital signature stored in the personal certificate store on the client computer
• -Password passwd
• Signifies the password used for signing the manifest file with a digital signature
Lab: Deploying Applications
• Exercise 1: Developing a Stand-Alone Installer
• Exercise 2: Configuring a ClickOnce Deployment
• Exercise 3: Updating a ClickOnce Deployment
Logon information
Estimated time: 60 minutes
Lab Scenario
You have been asked to develop deployment packages for both the Product Inventory application and the Work Orders application. The Product Inventory application usage is isolated to a small number of users and is not updated very often; therefore, you are to develop a stand-alone installer for that application. However, the Work Orders application is used widely throughout the organization in many locations, with an active development and release cycle; therefore, you need to develop a ClickOnce deployment for that application.
Lab Review
Review Questions
• Which project template enables you to create a Windows Installer package for an application?
• What do you need to do before you can configure an application for ClickOnce deployment from a UNC share?
• What happens if an application is configured to check for updates each time it runs and you modify the published application?
Module Review and Takeaways
• Review Questions
• Best Practices
• Tools
Course Evaluation