Deploying and Maintaining Smart Client Applications.Henrik Lykke Nielsen Software arkitekt, Captator...

38

Transcript of Deploying and Maintaining Smart Client Applications.Henrik Lykke Nielsen Software arkitekt, Captator...

Page 1: Deploying and Maintaining Smart Client Applications.Henrik Lykke Nielsen Software arkitekt, Captator Microsoft Regional Director for Denmark lykke@captator.dk.
Page 2: Deploying and Maintaining Smart Client Applications.Henrik Lykke Nielsen Software arkitekt, Captator Microsoft Regional Director for Denmark lykke@captator.dk.

Deploying and Deploying and Maintaining Smart Client Maintaining Smart Client ApplicationsApplications

.Henrik Lykke Nielsen.Henrik Lykke NielsenSoftware arkitekt, CaptatorSoftware arkitekt, CaptatorMicrosoft Regional Director for DenmarkMicrosoft Regional Director for Denmark

[email protected]@captator.dkwww.captator.dk/captator.aspx?www.captator.dk/captator.aspx?blog=dothenrikblog=dothenrik

Page 3: Deploying and Maintaining Smart Client Applications.Henrik Lykke Nielsen Software arkitekt, Captator Microsoft Regional Director for Denmark lykke@captator.dk.

Today's AgendaToday's Agenda

Best practices for building well-designed, Best practices for building well-designed, secure, data-driven, smart client secure, data-driven, smart client applicationsapplications

Session 1: Designing and building Session 1: Designing and building smart clientssmart clients

Patterns and practices for smart clients, Patterns and practices for smart clients, IssueVisionIssueVision

Session 2: Securing smart client Session 2: Securing smart client applicationsapplications

Tips for secure data, CAS, encryption, and moreTips for secure data, CAS, encryption, and more

Session 3: The ins and outs of secure Session 3: The ins and outs of secure data accessdata access

Best practices for smart client data, offline dataBest practices for smart client data, offline data

Session 4: Deploying and maintaining Session 4: Deploying and maintaining smart clientssmart clients

Tips for deploying and updating apps to avoid Tips for deploying and updating apps to avoid “DLL Hell”“DLL Hell”

Page 4: Deploying and Maintaining Smart Client Applications.Henrik Lykke Nielsen Software arkitekt, Captator Microsoft Regional Director for Denmark lykke@captator.dk.

AgendaAgenda

The “Deployment Big 3” for smart The “Deployment Big 3” for smart clientsclients

Drill-Down: Design choices for Drill-Down: Design choices for deployment deployment

No Touch Deployment optionsNo Touch Deployment options

Installing the .NET runtime with your appInstalling the .NET runtime with your app

Best practices for deploying Smart Client Best practices for deploying Smart Client apps apps

Drill-Down: Design choices for Drill-Down: Design choices for updatingupdating

Automatic update optionsAutomatic update options

Best practices for updating Smart Client Best practices for updating Smart Client appsapps

Page 5: Deploying and Maintaining Smart Client Applications.Henrik Lykke Nielsen Software arkitekt, Captator Microsoft Regional Director for Denmark lykke@captator.dk.

Avoid CollisionsAvoid Collisions

Avoid collisions between apps and versions!Avoid collisions between apps and versions!Installing App B must not break App AInstalling App B must not break App A

.NET Application Isolation .NET Application Isolation Private deployment by defaultPrivate deployment by default

By default .NET applications use the assembly By default .NET applications use the assembly versions they were built with, not the latestversions they were built with, not the latest

Multiple versions coexist by defaultMultiple versions coexist by default““Side-by-Side” installationSide-by-Side” installationSharing, if any, is controlled and explicitSharing, if any, is controlled and explicitCan be shared by installing to the Global Assembly Can be shared by installing to the Global Assembly Cache (GAC)Cache (GAC)

No DLL registrationNo DLL registrationJust copy filesJust copy files

Page 6: Deploying and Maintaining Smart Client Applications.Henrik Lykke Nielsen Software arkitekt, Captator Microsoft Regional Director for Denmark lykke@captator.dk.

Protect Resources and Protect Resources and DataDataControl which local data and resources Control which local data and resources

your application may access!your application may access!

.NET Code Access Security.NET Code Access SecurityAccess is controlled based on evidenceAccess is controlled based on evidence

Who created the program (code signing)Who created the program (code signing)

Where the program came fromWhere the program came fromCorporate intranet, specific manufacturer, Web site, Corporate intranet, specific manufacturer, Web site, etc.etc.

In .NET, resource security can be In .NET, resource security can be controlled at deployment timecontrolled at deployment time

Tools including CASPOL and Group Policy Tools including CASPOL and Group Policy help administrators manage secure access help administrators manage secure access policiespolicies

Page 7: Deploying and Maintaining Smart Client Applications.Henrik Lykke Nielsen Software arkitekt, Captator Microsoft Regional Director for Denmark lykke@captator.dk.

Control CostsControl Costs

Control deployment and update costs!Control deployment and update costs!Easy, “self-service” installationEasy, “self-service” installation

Automatic detection and download of Automatic detection and download of updatesupdates

Low Cost .NET Deploy and UpdateLow Cost .NET Deploy and UpdateJust copy files to the deployment Just copy files to the deployment locationlocation

.NET No Touch Updates detect, .NET No Touch Updates detect, download and apply updatesdownload and apply updates

Page 8: Deploying and Maintaining Smart Client Applications.Henrik Lykke Nielsen Software arkitekt, Captator Microsoft Regional Director for Denmark lykke@captator.dk.

Drill-Down: Drill-Down: Design Choices for Design Choices for DeploymentDeployment

• Run From Web

• Code Download

• MSI-Deployed

• Installing the .NET Framework

Page 9: Deploying and Maintaining Smart Client Applications.Henrik Lykke Nielsen Software arkitekt, Captator Microsoft Regional Director for Denmark lykke@captator.dk.

Deployment OptionsDeployment Options

.NET offers several options for .NET offers several options for deploying and installing smart clientsdeploying and installing smart clientsThis discussion focuses on three This discussion focuses on three common choices:common choices:

Run From WebRun From WebUser runs the app by clicking a link in a Web User runs the app by clicking a link in a Web pagepage

Code downloadCode downloadUser runs a bootstrap program from their User runs a bootstrap program from their desktop that downloads and executes code desktop that downloads and executes code from the Web (or intranet)from the Web (or intranet)

MSI-deployedMSI-deployedUser runs the application locally. The User runs the application locally. The application downloads updates from the Web application downloads updates from the Web (or intranet)(or intranet)

Page 10: Deploying and Maintaining Smart Client Applications.Henrik Lykke Nielsen Software arkitekt, Captator Microsoft Regional Director for Denmark lykke@captator.dk.

Run From WebRun From Web

Entire app is downloaded to Entire app is downloaded to Assembly Download CacheAssembly Download Cache

IEExec process launches the app with IEExec process launches the app with restricted security settingsrestricted security settings

AdvantagesAdvantagesVery easy to deploy / updateVery easy to deploy / update

LimitationsLimitationsRuns only inside Internet Explorer 5.01+ Runs only inside Internet Explorer 5.01+

Semi-trustedSemi-trusted

Can be difficult for users to discoverCan be difficult for users to discover

Page 11: Deploying and Maintaining Smart Client Applications.Henrik Lykke Nielsen Software arkitekt, Captator Microsoft Regional Director for Denmark lykke@captator.dk.

Run From WebRun From Web

Page 12: Deploying and Maintaining Smart Client Applications.Henrik Lykke Nielsen Software arkitekt, Captator Microsoft Regional Director for Denmark lykke@captator.dk.

Run From WebRun From Web

Opsætning af sikkerhed på klientenOpsætning af sikkerhed på klientenLagret som XML i:Lagret som XML i:C:\WINDOWS\Microsoft.NET\Framework\C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\CONFIGv1.1.4322\CONFIG

.NET Framework 1.1 Configuration MMC .NET Framework 1.1 Configuration MMC snap-insnap-in

CASPOL command line toolCASPOL command line tool

Via MSI:Via MSI:Lavet vha. .NET Framework Configuration Lavet vha. .NET Framework Configuration snap-insnap-in

Vha. kode: System.Security.Policy Vha. kode: System.Security.Policy namespacetnamespacet

Page 13: Deploying and Maintaining Smart Client Applications.Henrik Lykke Nielsen Software arkitekt, Captator Microsoft Regional Director for Denmark lykke@captator.dk.

Code DownloadCode Download

Program is partitioned into Program is partitioned into assemblies that are downloaded as assemblies that are downloaded as neededneeded

‘‘Stub’ program is installed on local PCStub’ program is installed on local PC

The stub downloads and runs assemblies The stub downloads and runs assemblies from the Web or intranet using from the Web or intranet using Assembly.LoadFrom()Assembly.LoadFrom()

AdvantagesAdvantagesSmall installation size, incremental Small installation size, incremental updatesupdates

Launched from My ProgramsLaunched from My Programs

Fairly easy to deploy and updateFairly easy to deploy and update

Page 14: Deploying and Maintaining Smart Client Applications.Henrik Lykke Nielsen Software arkitekt, Captator Microsoft Regional Director for Denmark lykke@captator.dk.

Code Download, continuedCode Download, continuedLimitationsLimitations

Application must be factored appropriately Application must be factored appropriately (hard to do)(hard to do)

Local footprint requires an install processLocal footprint requires an install process

No support for working offlineNo support for working offline

No support for side-by-side versionsNo support for side-by-side versions

Updates occur only when app or module is Updates occur only when app or module is loadedloaded

Permissions based on where assembly came Permissions based on where assembly came fromfrom

Must be connectedMust be connected

Best used for…Best used for…Apps that have distinct functional modules Apps that have distinct functional modules

Apps that can tolerate download delaysApps that can tolerate download delays

Page 15: Deploying and Maintaining Smart Client Applications.Henrik Lykke Nielsen Software arkitekt, Captator Microsoft Regional Director for Denmark lykke@captator.dk.

Code DownloadCode Download

Page 16: Deploying and Maintaining Smart Client Applications.Henrik Lykke Nielsen Software arkitekt, Captator Microsoft Regional Director for Denmark lykke@captator.dk.

Client Install Via MSIClient Install Via MSI

Deployed to a client machine from a Deployed to a client machine from a web location, a UNC share or a file web location, a UNC share or a file locationlocation

Functions like a standard Windows Functions like a standard Windows applicationapplication

AdvantagesAdvantagesBest range of Smart Client functionality, Best range of Smart Client functionality, including offlineincluding offlineBest performanceBest performanceBest integration with the Windows shellBest integration with the Windows shell

My Programs shortcuts, Add/Remove My Programs shortcuts, Add/Remove programsprograms

Supports working offlineSupports working offlineSupports updater technologiesSupports updater technologies

Page 17: Deploying and Maintaining Smart Client Applications.Henrik Lykke Nielsen Software arkitekt, Captator Microsoft Regional Director for Denmark lykke@captator.dk.

Client Install Via MSI, cont.Client Install Via MSI, cont.

LimitationsLimitationsLocal footprint requires an install processLocal footprint requires an install process

Best used for…Best used for…Apps that require the best possible client Apps that require the best possible client performanceperformance

Apps that let the user work offlineApps that let the user work offline

Apps that access local resourcesApps that access local resources

Apps that support side-by-side versionsApps that support side-by-side versions

Page 18: Deploying and Maintaining Smart Client Applications.Henrik Lykke Nielsen Software arkitekt, Captator Microsoft Regional Director for Denmark lykke@captator.dk.

Bundling the .NET Bundling the .NET FrameworkFramework

Free redistributable version of .NET Free redistributable version of .NET FrameworkFramework

Stand-alone executable file, Stand-alone executable file, dotnetfx.exedotnetfx.exe

Distribute via SMS, Active Directory or bundle Distribute via SMS, Active Directory or bundle with appwith app

More information:More information:http://msdn.microsoft.com/library/en-us/dnnetdep/htmhttp://msdn.microsoft.com/library/en-us/dnnetdep/html/redistdeploy1_1.aspl/redistdeploy1_1.asp

Example project from MSDNExample project from MSDNhttp://www.microsoft.com/downloads/http://www.microsoft.com/downloads/details.aspx?FamilyIddetails.aspx?FamilyId=BF253CFD-1EFC-4FC5-BA7E-6A6F21403495=BF253CFD-1EFC-4FC5-BA7E-6A6F21403495

Shareware plug-in to Visual Studio .NETShareware plug-in to Visual Studio .NETAutomates adding dotnetfx.exe to you setup projectAutomates adding dotnetfx.exe to you setup project

http://http://www.gotdotnet.com/community/workspaces/workspacwww.gotdotnet.com/community/workspaces/workspace.aspx?IDe.aspx?ID=2F8F0A23-F529-4158-8E0A-D187D16F41F1=2F8F0A23-F529-4158-8E0A-D187D16F41F1

Page 19: Deploying and Maintaining Smart Client Applications.Henrik Lykke Nielsen Software arkitekt, Captator Microsoft Regional Director for Denmark lykke@captator.dk.

Best Practices #1: Best Practices #1: DeploymentDeployment

Design up front for deploymentDesign up front for deploymentChoose the deployment option that best fits Choose the deployment option that best fits your app…your app…

PerformancePerformanceSecuritySecurityFunctionalityFunctionality

And, helps you control maintenance costsAnd, helps you control maintenance costsBe careful about sharing code between Be careful about sharing code between applicationsapplications

Use application isolation to avoid future collisionsUse application isolation to avoid future collisions

Grant access only to the resources and Grant access only to the resources and data it needsdata it needsBundle .NET with your application if users Bundle .NET with your application if users might not have it alreadymight not have it already

Page 20: Deploying and Maintaining Smart Client Applications.Henrik Lykke Nielsen Software arkitekt, Captator Microsoft Regional Director for Denmark lykke@captator.dk.

Drill-Down: Drill-Down: Design Choices for Design Choices for UpdatingUpdating

• Update Web Hosted DLLs

• Application Updater

Page 21: Deploying and Maintaining Smart Client Applications.Henrik Lykke Nielsen Software arkitekt, Captator Microsoft Regional Director for Denmark lykke@captator.dk.

Updating OptionsUpdating Options

““Always up-to-date”Always up-to-date”Run-From-Web and Code Download apps Run-From-Web and Code Download apps

““Price” is no side-by-sidePrice” is no side-by-side

Application UpdaterApplication UpdaterTwo code blocks from Microsoft make Two code blocks from Microsoft make updating client-installed applications updating client-installed applications easiereasier

AppUpdater componentAppUpdater componentEasier to implementEasier to implement

Updater Application BlockUpdater Application BlockBest choice for enterprise-grade applicationsBest choice for enterprise-grade applications

Page 22: Deploying and Maintaining Smart Client Applications.Henrik Lykke Nielsen Software arkitekt, Captator Microsoft Regional Director for Denmark lykke@captator.dk.

Application UpdaterApplication Updater

How it works:How it works:Polls for available updatesPolls for available updates

Detects via manifest file or folder/file checkDetects via manifest file or folder/file check

Downloads updates in the backgroundDownloads updates in the backgroundApplies updatesApplies updatesRestarts the applicationRestarts the application

.NET Application Updater Component.NET Application Updater Componentwindowsforms.net/articles/windowsforms.net/articles/appupdater.aspxappupdater.aspx

Application Updater Block from Application Updater Block from Patterns and PracticesPatterns and Practices

http://msdn.microsoft.com/library/en-http://msdn.microsoft.com/library/en-us/dnbda/html/updater.asp us/dnbda/html/updater.asp

Page 23: Deploying and Maintaining Smart Client Applications.Henrik Lykke Nielsen Software arkitekt, Captator Microsoft Regional Director for Denmark lykke@captator.dk.
Page 24: Deploying and Maintaining Smart Client Applications.Henrik Lykke Nielsen Software arkitekt, Captator Microsoft Regional Director for Denmark lykke@captator.dk.
Page 25: Deploying and Maintaining Smart Client Applications.Henrik Lykke Nielsen Software arkitekt, Captator Microsoft Regional Director for Denmark lykke@captator.dk.
Page 26: Deploying and Maintaining Smart Client Applications.Henrik Lykke Nielsen Software arkitekt, Captator Microsoft Regional Director for Denmark lykke@captator.dk.
Page 27: Deploying and Maintaining Smart Client Applications.Henrik Lykke Nielsen Software arkitekt, Captator Microsoft Regional Director for Denmark lykke@captator.dk.
Page 28: Deploying and Maintaining Smart Client Applications.Henrik Lykke Nielsen Software arkitekt, Captator Microsoft Regional Director for Denmark lykke@captator.dk.
Page 29: Deploying and Maintaining Smart Client Applications.Henrik Lykke Nielsen Software arkitekt, Captator Microsoft Regional Director for Denmark lykke@captator.dk.
Page 30: Deploying and Maintaining Smart Client Applications.Henrik Lykke Nielsen Software arkitekt, Captator Microsoft Regional Director for Denmark lykke@captator.dk.
Page 31: Deploying and Maintaining Smart Client Applications.Henrik Lykke Nielsen Software arkitekt, Captator Microsoft Regional Director for Denmark lykke@captator.dk.
Page 32: Deploying and Maintaining Smart Client Applications.Henrik Lykke Nielsen Software arkitekt, Captator Microsoft Regional Director for Denmark lykke@captator.dk.

Deploying and Deploying and Updating IssueVisionUpdating IssueVision

Page 33: Deploying and Maintaining Smart Client Applications.Henrik Lykke Nielsen Software arkitekt, Captator Microsoft Regional Director for Denmark lykke@captator.dk.

Captator.Eifos.UpdatingCaptator.Eifos.Updating

Launcher.exe startes i stedet for selve Launcher.exe startes i stedet for selve app’enapp’enAuthentication mod XML web service Authentication mod XML web service (WSE2)(WSE2)Henter AppInfo og info om download-Henter AppInfo og info om download-server(e) fra central server (via WS)server(e) fra central server (via WS)

Kan eksempelvis afhænge af authenticated Kan eksempelvis afhænge af authenticated brugerbrugerSammenligner med lokal AppInfoSammenligner med lokal AppInfo

Henter og installerer nye komponenter Henter og installerer nye komponenter (WSE2)(WSE2)

IDirectoryStrategyIDirectoryStrategy

Kalder eventuelle upgrade Kalder eventuelle upgrade funktionaliteterfunktionaliteterLauncher (nyeste) version af Launcher (nyeste) version af applikationenapplikationen

Page 34: Deploying and Maintaining Smart Client Applications.Henrik Lykke Nielsen Software arkitekt, Captator Microsoft Regional Director for Denmark lykke@captator.dk.

Best Practices for UpdatingBest Practices for Updating

Design and plan for updating Design and plan for updating

Evaluate updating deployment Evaluate updating deployment optionsoptions

Web-Deployed, Code Download Web-Deployed, Code Download Check for updates every time they are Check for updates every time they are launchedlaunched

Check for updates Check for updates onlyonly when they are when they are launchedlaunched

MSI-Deployed MSI-Deployed Supports side-by-side versionsSupports side-by-side versions

Can automatically update the running Can automatically update the running applicationapplication

Use Application Updater blockUse Application Updater block

Page 35: Deploying and Maintaining Smart Client Applications.Henrik Lykke Nielsen Software arkitekt, Captator Microsoft Regional Director for Denmark lykke@captator.dk.

SummarySummary

.NET solves the “Deployment Big 3” for .NET solves the “Deployment Big 3” for smart client applicationssmart client applications

Avoids collisions, protects resources and data, Avoids collisions, protects resources and data, controls deployment and updates costscontrols deployment and updates costs

Control your deployment costs by installing Control your deployment costs by installing applications from an intranet or Internet applications from an intranet or Internet locationlocation

Control your maintenance costs using No Control your maintenance costs using No Touch updatingTouch updating

Use Updater Application Block for enterprise-Use Updater Application Block for enterprise-grade applicationsgrade applications

Page 36: Deploying and Maintaining Smart Client Applications.Henrik Lykke Nielsen Software arkitekt, Captator Microsoft Regional Director for Denmark lykke@captator.dk.

ResourcesResourcesDeploying and Distributing OverviewDeploying and Distributing Overviewhttp://msdn.microsoft.com/vbasic/using/deployinghttp://msdn.microsoft.com/vbasic/using/deploying

Patterns and PracticesPatterns and Practiceswww.microsoft.com/resources/practices/bytaskImplewww.microsoft.com/resources/practices/bytaskImplement.aspment.asp

.NET Framework 1.1 Deployment Guide.NET Framework 1.1 Deployment Guidemsdn.microsoft.com/library/default.asp?url=/library/emsdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetdep/html/dotnetframedepguid1_1.asp?_r=1n-us/dnnetdep/html/dotnetframedepguid1_1.asp?_r=1

Microsoft Visual Studio .NET 2003 Microsoft Visual Studio .NET 2003 Bootstrapper Plug-InBootstrapper Plug-Inwww.microsoft.com/downloads/details.aspx?www.microsoft.com/downloads/details.aspx?

FamilyId=627921A0-D9E7-43D6-A293-FamilyId=627921A0-D9E7-43D6-A293-2F9C370BD19&displaylang=en2F9C370BD19&displaylang=en

Nyheder, artikler, information, …Nyheder, artikler, information, …www.captator.dkwww.captator.dk

Page 37: Deploying and Maintaining Smart Client Applications.Henrik Lykke Nielsen Software arkitekt, Captator Microsoft Regional Director for Denmark lykke@captator.dk.

Smart Clients in ReviewSmart Clients in Review

The best of Windows with the best of the WebThe best of Windows with the best of the WebCost-effective deployment of programs and updatesCost-effective deployment of programs and updates

Best practice for data: Best practice for data: Use stored procedures, if possibleUse stored procedures, if possible

Use optimistic concurrencyUse optimistic concurrency

For offline data, use DataSet to help you work with data For offline data, use DataSet to help you work with data locally, and sync changes back to the serverlocally, and sync changes back to the server

Best practice for security: Let it work for you! Best practice for security: Let it work for you! Smart Client apps give you fine grain control over who Smart Client apps give you fine grain control over who gets to do (or see) what.gets to do (or see) what.

Best practice for deployment: Control your Best practice for deployment: Control your deployment costs by downloading applications deployment costs by downloading applications and updates from an intranet or Internet locationand updates from an intranet or Internet location

Page 38: Deploying and Maintaining Smart Client Applications.Henrik Lykke Nielsen Software arkitekt, Captator Microsoft Regional Director for Denmark lykke@captator.dk.

© 2003-2004 Microsoft Corporation. All rights reserved.This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.