Top Banner
Smart Client Deployment with ClickOnce Brian Noyes IDesign, Inc. (www.idesign.net ) [email protected]
34

Noyes VSConnections VDP351 Smart Client Deployment with ... · Agenda •ClickOnce Overview •Deploying with ClickOnce •Updating Apps with ClickOnce •Elevating Security for Deployed

Apr 06, 2020

Download

Documents

dariahiddleston
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: Noyes VSConnections VDP351 Smart Client Deployment with ... · Agenda •ClickOnce Overview •Deploying with ClickOnce •Updating Apps with ClickOnce •Elevating Security for Deployed

Smart Client Deployment with ClickOnce

Brian NoyesIDesign, Inc. (www.idesign.net)

[email protected]

Page 2: Noyes VSConnections VDP351 Smart Client Deployment with ... · Agenda •ClickOnce Overview •Deploying with ClickOnce •Updating Apps with ClickOnce •Elevating Security for Deployed

About Brian

• Principal Software Architect, IDesign Inc. (www.idesign.net) • Microsoft MVP in ASP.NET• Writing

● MSDN Magazine, asp.netPRO, Visual Studio Magazine, .NET Developer’s Journal

● Building Windows Forms Data Applications with .NET 2.0, Addison-Wesley, expected release spring 2005

• Speaking● Microsoft TechEd, Visual Studio Connections, DevEssentials, VSLive!,

INETA Speakers Bureau• Participates in Microsoft design reviews• E-mail: [email protected]• Blog: http://www.softinsight.com/bnoyes

Page 3: Noyes VSConnections VDP351 Smart Client Deployment with ... · Agenda •ClickOnce Overview •Deploying with ClickOnce •Updating Apps with ClickOnce •Elevating Security for Deployed

Agenda

• ClickOnce Overview• Deploying with ClickOnce• Updating Apps with ClickOnce• Elevating Security for Deployed Apps• On-Demand Updates• Under the Covers – Manifests• Wrap up

Page 4: Noyes VSConnections VDP351 Smart Client Deployment with ... · Agenda •ClickOnce Overview •Deploying with ClickOnce •Updating Apps with ClickOnce •Elevating Security for Deployed

What is a Smart Client?

• Rich user interface (WinForms)• Connects to back-end services• Runs securely on the client• Supports disconnected operations• Supports auto-deployment and update over the

network

Page 5: Noyes VSConnections VDP351 Smart Client Deployment with ... · Agenda •ClickOnce Overview •Deploying with ClickOnce •Updating Apps with ClickOnce •Elevating Security for Deployed

Smart Client Deployment Challenge

• Conflicting goals:● Richest possible user experience● Support disconnected / mobile application use● Deploy with minimal cost and effort● Keep up to date

• Deployment and Maintenance are significant costs in any distributed application life cycle

Page 6: Noyes VSConnections VDP351 Smart Client Deployment with ... · Agenda •ClickOnce Overview •Deploying with ClickOnce •Updating Apps with ClickOnce •Elevating Security for Deployed

ClickOnce Deployment Technology

• Microsoft® Windows Smart Client deployment technology

• Microsoft® .NET 2.0 Feature• Addresses all the previous challenges• Further enhanced in Longhorn• Goals:

● Rich client experience of a Windows-based app● Ease of deployment and update of a Web app

Page 7: Noyes VSConnections VDP351 Smart Client Deployment with ... · Agenda •ClickOnce Overview •Deploying with ClickOnce •Updating Apps with ClickOnce •Elevating Security for Deployed

ClickOnce Concept

• Single user action triggers deployment and execution

• Download and run from cache• Install and execute in secure sandbox • Auto detect and apply updates• Allow offline / disconnected operations

Page 8: Noyes VSConnections VDP351 Smart Client Deployment with ... · Agenda •ClickOnce Overview •Deploying with ClickOnce •Updating Apps with ClickOnce •Elevating Security for Deployed

Target Applications

• Line-of-Business applications● Customer Resource Management● Personnel management● Business analysis tools

• Consumer applications● Games● Multimedia apps

• Microsoft® Office Documents● Visual Studio® Tools for Office System 2003

Page 9: Noyes VSConnections VDP351 Smart Client Deployment with ... · Agenda •ClickOnce Overview •Deploying with ClickOnce •Updating Apps with ClickOnce •Elevating Security for Deployed

Application Requirements

• No code requirements• No class derivation• No interface implementation• Optional: On demand update code• Can even deploy Microsoft® .NET 1.X apps

Page 10: Noyes VSConnections VDP351 Smart Client Deployment with ... · Agenda •ClickOnce Overview •Deploying with ClickOnce •Updating Apps with ClickOnce •Elevating Security for Deployed

Architecture Requirements

• Client machine:● Must have Microsoft® .NET Framework 2.0 or later on it● Can be deployed through bootstrapper, but user must be

admin● Enhanced experience in Longhorn

• Server:● No .NET required● Can be any web or file server● Place the files + manifests in a folder

Page 11: Noyes VSConnections VDP351 Smart Client Deployment with ... · Agenda •ClickOnce Overview •Deploying with ClickOnce •Updating Apps with ClickOnce •Elevating Security for Deployed

ClickOnce Bootstrapper

• Installs prerequisites on the client● .NET Framework● MDAC● Windows Installer● Custom Requirements

• Requires Admin privilege• Separate install URL

Page 12: Noyes VSConnections VDP351 Smart Client Deployment with ... · Agenda •ClickOnce Overview •Deploying with ClickOnce •Updating Apps with ClickOnce •Elevating Security for Deployed

ClickOnce vs. MSI

• Not a replacement for Microsoft® Windows®Installer (MSI)● Complements for Smart Client scenarios

• Still may need Windows Installer for many apps

Page 13: Noyes VSConnections VDP351 Smart Client Deployment with ... · Agenda •ClickOnce Overview •Deploying with ClickOnce •Updating Apps with ClickOnce •Elevating Security for Deployed

Agenda

• ClickOnce Overview• Deploying with ClickOnce• Updating Apps with ClickOnce• Elevating Security for Deployed Apps• On-Demand Updates• Under the Covers – Manifests• Wrap up

Page 14: Noyes VSConnections VDP351 Smart Client Deployment with ... · Agenda •ClickOnce Overview •Deploying with ClickOnce •Updating Apps with ClickOnce •Elevating Security for Deployed

Deployment Models

• “Launched”● Available online only● App files cached under user profile for speedy

launch •C:\Documents and Settings\<user>\Local Settings\Apps

Page 15: Noyes VSConnections VDP351 Smart Client Deployment with ... · Agenda •ClickOnce Overview •Deploying with ClickOnce •Updating Apps with ClickOnce •Elevating Security for Deployed

Deployment Models

• “Installed”● Available online or offline● Files cached under user profile on local machine● Start menu item for subsequent launch● Add/Remove Programs item added

Page 16: Noyes VSConnections VDP351 Smart Client Deployment with ... · Agenda •ClickOnce Overview •Deploying with ClickOnce •Updating Apps with ClickOnce •Elevating Security for Deployed

Agenda

• ClickOnce Overview• Deploying with ClickOnce• Updating Apps with ClickOnce• Elevating Security for Deployed Apps• On-Demand Updates• Under the Covers – Manifests• Wrap up

Page 17: Noyes VSConnections VDP351 Smart Client Deployment with ... · Agenda •ClickOnce Overview •Deploying with ClickOnce •Updating Apps with ClickOnce •Elevating Security for Deployed

Update options

• Launched apps● Always check for new versions and download before running

• Installed apps● Check for updates● Optional / Required● Check before run / background while running● Check every time / every XX interval● Check for updates at location XX● On-demand with API

Page 18: Noyes VSConnections VDP351 Smart Client Deployment with ... · Agenda •ClickOnce Overview •Deploying with ClickOnce •Updating Apps with ClickOnce •Elevating Security for Deployed

ClickOnce in Action

Client

File or Web Server

App / Web / DBserver

<soap><foo>

DB

xxxxxxxxx

1.0

1.0

Launch App

2.0

xxxxxxxxx

2.0

BLL

Page 19: Noyes VSConnections VDP351 Smart Client Deployment with ... · Agenda •ClickOnce Overview •Deploying with ClickOnce •Updating Apps with ClickOnce •Elevating Security for Deployed

Scaling Out with ClickOnce

Client

File or Web Server

App / Web / DBserver

<soap><foo>

DB

xxxxxxxxx

1.0

Launch App

BLL

Page 20: Noyes VSConnections VDP351 Smart Client Deployment with ... · Agenda •ClickOnce Overview •Deploying with ClickOnce •Updating Apps with ClickOnce •Elevating Security for Deployed

Demo #1

ClickOnce Deployment and Update

Page 21: Noyes VSConnections VDP351 Smart Client Deployment with ... · Agenda •ClickOnce Overview •Deploying with ClickOnce •Updating Apps with ClickOnce •Elevating Security for Deployed

Agenda

• ClickOnce Overview• Deploying with ClickOnce• Updating Apps with ClickOnce• Elevating Security for Deployed Apps• On-Demand Updates• Under the Covers – Manifests• Wrap up

Page 22: Noyes VSConnections VDP351 Smart Client Deployment with ... · Agenda •ClickOnce Overview •Deploying with ClickOnce •Updating Apps with ClickOnce •Elevating Security for Deployed

Security Features

• Zero-impact installation● Files cached under user profile● Cannot touch shared resources on machine

• Code Access Security sandbox execution● Based on origin of files (deployment server)● Can elevate permissions through user prompting● Can elevate permissions automatically through trusted

publisher

• XML Signature● Signed manifests to ensure authentication and integrity

Page 23: Noyes VSConnections VDP351 Smart Client Deployment with ... · Agenda •ClickOnce Overview •Deploying with ClickOnce •Updating Apps with ClickOnce •Elevating Security for Deployed

Demo #2

Elevating Security Permissions

Page 24: Noyes VSConnections VDP351 Smart Client Deployment with ... · Agenda •ClickOnce Overview •Deploying with ClickOnce •Updating Apps with ClickOnce •Elevating Security for Deployed

Agenda

• ClickOnce Overview• Deploying with ClickOnce• Updating Apps with ClickOnce• Elevating Security for Deployed Apps• On-Demand Updates• Under the Covers – Manifests• Wrap up

Page 25: Noyes VSConnections VDP351 Smart Client Deployment with ... · Agenda •ClickOnce Overview •Deploying with ClickOnce •Updating Apps with ClickOnce •Elevating Security for Deployed

On Demand Updates

• System.Deployment namespace● ApplicationUpdaterService class

•CheckForUpdates•Update•Application.Restart•Async versions available

Page 26: Noyes VSConnections VDP351 Smart Client Deployment with ... · Agenda •ClickOnce Overview •Deploying with ClickOnce •Updating Apps with ClickOnce •Elevating Security for Deployed

Demo #3

On Demand Updates

Page 27: Noyes VSConnections VDP351 Smart Client Deployment with ... · Agenda •ClickOnce Overview •Deploying with ClickOnce •Updating Apps with ClickOnce •Elevating Security for Deployed

Agenda

• ClickOnce Overview• Deploying with ClickOnce• Updating Apps with ClickOnce• Elevating Security for Deployed Apps• On-Demand Updates• Under the Covers – Manifests• Wrap up

Page 28: Noyes VSConnections VDP351 Smart Client Deployment with ... · Agenda •ClickOnce Overview •Deploying with ClickOnce •Updating Apps with ClickOnce •Elevating Security for Deployed

Manifest Files

• Deployment manifest● Describe deployment model and update policy● Point to application manifest● Digital signature

• Application manifest● Describe application● Identify application files and dependencies● Declare security permission requirements● Digital signature

Page 29: Noyes VSConnections VDP351 Smart Client Deployment with ... · Agenda •ClickOnce Overview •Deploying with ClickOnce •Updating Apps with ClickOnce •Elevating Security for Deployed

Demo #4

Behind the Scenes

Page 30: Noyes VSConnections VDP351 Smart Client Deployment with ... · Agenda •ClickOnce Overview •Deploying with ClickOnce •Updating Apps with ClickOnce •Elevating Security for Deployed

Agenda

• ClickOnce Overview• Deploying with ClickOnce• Updating Apps with ClickOnce• Elevating Security for Deployed Apps• On-Demand Updates• Under the Covers – Manifests• Wrap up

Page 31: Noyes VSConnections VDP351 Smart Client Deployment with ... · Agenda •ClickOnce Overview •Deploying with ClickOnce •Updating Apps with ClickOnce •Elevating Security for Deployed

Visual Studio Tools

• Debug in Zone● Run in specified context to simulate deployed

environment

• Permissions Calculator● Analyze your code and tell you exactly what

permissions it requires

Page 32: Noyes VSConnections VDP351 Smart Client Deployment with ... · Agenda •ClickOnce Overview •Deploying with ClickOnce •Updating Apps with ClickOnce •Elevating Security for Deployed

ClickOnce Enhancements in Longhorn

• Background Intelligent Transfer Service (BITS) download

• Secure Execution Environment● More tightly integrated with the OS● Options to run within IE context or as standalone

app

• Windows Shell Integration• More to follow?

Page 33: Noyes VSConnections VDP351 Smart Client Deployment with ... · Agenda •ClickOnce Overview •Deploying with ClickOnce •Updating Apps with ClickOnce •Elevating Security for Deployed

What Can You Do Today?

• No Touch Deployment● Like a launched ClickOnce application● Must configure security on user machine● Can use local machine bootstrap app to circumvent

security

• Updater Application Block● Automatic checking for available updates● Download and apply● Have to write a little code + reference the block

Page 34: Noyes VSConnections VDP351 Smart Client Deployment with ... · Agenda •ClickOnce Overview •Deploying with ClickOnce •Updating Apps with ClickOnce •Elevating Security for Deployed

Resources

• Trustworthy Smart Client Deployment with ClickOnce, Brian Noyes, MSDN Magazine, May 2004. http://www.msdn.microsoft.com/msdnmag/issues/04/05/ClickOnce/default.aspx

• .NET Rocks! interview: http://www.franklins.net/fnetdotnetrocks/dotnetrocks.aspx?showid=48

• Updater Application Block: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbda/html/updater.asp

• No Touch Deployment: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vstechart/html/vbtchno-touchdeploymentinnetframework.asp

EE--mailmail: : [email protected]@idesign.netBlogBlog: : http://www.softinsight.com/bnoyeshttp://www.softinsight.com/bnoyes