deploy .net applications with ease

29
Deploy .NET Applications with Ease Brian Noyes Brian Noyes IDesign, Inc. IDesign, Inc. www.idesign.net www.idesign.net

Upload: blaze

Post on 12-Jan-2016

73 views

Category:

Documents


1 download

DESCRIPTION

Deploy .NET Applications with Ease. Brian Noyes IDesign, Inc. www.idesign.net. About Brian. Software Architect, IDesign, Inc. (www.idesign.net) Microsoft MVP in ASP.NET Writing MSDN Magazine, asp.netPRO, Visual Studio Magazine, .NET Developer’s Journal - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Deploy .NET Applications with Ease

Deploy .NET Applications with EaseDeploy .NET Applications with Ease

Brian NoyesBrian NoyesIDesign, Inc.IDesign, Inc.www.idesign.netwww.idesign.net

Page 2: Deploy .NET Applications with Ease

About BrianAbout Brian

Software Architect, IDesign, Inc. Software Architect, IDesign, Inc. (www.idesign.net)(www.idesign.net)Microsoft MVP in ASP.NETMicrosoft MVP in ASP.NETWritingWriting

MSDN Magazine, asp.netPRO, Visual Studio MSDN Magazine, asp.netPRO, Visual Studio Magazine, .NET Developer’s JournalMagazine, .NET Developer’s JournalBuilding Windows Forms Data Applications Building Windows Forms Data Applications with .NET 2.0, Addison-Wesley, expected release with .NET 2.0, Addison-Wesley, expected release spring 2005spring 2005

SpeakingSpeakingMicrosoft TechEd, Visual Studio Connections, Microsoft TechEd, Visual Studio Connections, DevEssentials, VSLive!, INETA Speakers BureauDevEssentials, VSLive!, INETA Speakers Bureau

Participate in Microsoft design reviewsParticipate in Microsoft design reviewsE-mail: [email protected]: [email protected]: http://www.softinsight.com/bnoyesBlog: http://www.softinsight.com/bnoyes

Page 3: Deploy .NET Applications with Ease

AgendaAgenda

Deployment ChallengesDeployment Challenges

Deployment ModelsDeployment Models

No Touch DeploymentNo Touch Deployment

Setup and Deployment ProjectsSetup and Deployment Projects

Custom InstallersCustom Installers

Page 4: Deploy .NET Applications with Ease

Deployment ChallengesDeployment ChallengesPlatform requirementsPlatform requirementsIntuitive and easy installer UIIntuitive and easy installer UIApplication artifact placementApplication artifact placement

Files / FoldersFiles / FoldersRegistryRegistryGlobal Assembly CacheGlobal Assembly CacheDatabasesDatabases

Custom install proceduresCustom install proceduresRemoving installation artifacts at Removing installation artifacts at uninstalluninstallHandling ErrorsHandling Errors

Page 5: Deploy .NET Applications with Ease

Deployment Models using the .NET FrameworkDeployment Models using the .NET Framework

xcopy deploymentxcopy deployment

No-Touch Deployment (NTD)No-Touch Deployment (NTD)

Updater Application BlockUpdater Application Block

Windows InstallerWindows Installer

.NET Framework 2.0: ClickOnce.NET Framework 2.0: ClickOnce

Page 6: Deploy .NET Applications with Ease

xcopy Deploymentxcopy Deployment

ProcessProcessCopy application files to appropriate Copy application files to appropriate folderfolder

RunRun

Page 7: Deploy .NET Applications with Ease

xcopy Deploymentxcopy Deployment

BenefitsBenefitsEasiest deployment modelEasiest deployment model

Limited potential for interference with Limited potential for interference with other applications at installother applications at install

Limited potential for interference with Limited potential for interference with other applications at runtimeother applications at runtime

Side-by-side versioning achieved through Side-by-side versioning achieved through physical separationphysical separation

Page 8: Deploy .NET Applications with Ease

xcopy Deploymentxcopy Deployment

DrawbacksDrawbacksMore files on diskMore files on disk

No shared physical implementation No shared physical implementation between appsbetween apps

Less centralized managementLess centralized management

Need to ensure all files are compatible Need to ensure all files are compatible versionsversions

Page 9: Deploy .NET Applications with Ease

No Touch Deployment (NTD)No Touch Deployment (NTD)

Otherwise known asOtherwise known asAuto-deploymentAuto-deploymentZero deploymentZero deploymenthref-exe deploymenthref-exe deployment

Page 10: Deploy .NET Applications with Ease

No Touch Deployment (NTD)No Touch Deployment (NTD)

ProcessProcessPlace application files on deployment Place application files on deployment (web) server(web) serverProvide URL to EXE to usersProvide URL to EXE to usersUsers click on URL to launchUsers click on URL to launchEXE and supporting DLLs downloaded EXE and supporting DLLs downloaded and cached on user machineand cached on user machineExecute in .NET runtime secure sandbox Execute in .NET runtime secure sandbox

Based on Code Access Security for the Based on Code Access Security for the deployment server locationdeployment server location

Deployment server is checked for new Deployment server is checked for new versions every time application is versions every time application is launchedlaunched

Page 11: Deploy .NET Applications with Ease

No Touch No Touch DeploymentDeploymentBrian NoyesBrian NoyesIDesign, Inc.IDesign, Inc.www.idesign.netwww.idesign.net

Page 12: Deploy .NET Applications with Ease

BenefitsBenefitsEasy deployment of smart client Easy deployment of smart client applicationsapplications

No need for admin to touch client No need for admin to touch client workstations for installworkstations for install

Auto-updating of application files based Auto-updating of application files based on deployment server versionson deployment server versions

Protected from malicious code executionProtected from malicious code execution

Easy, Web-like user experienceEasy, Web-like user experience

No Touch Deployment (NTD)No Touch Deployment (NTD)

Page 13: Deploy .NET Applications with Ease

No Touch Deployment (NTD)No Touch Deployment (NTD)

DrawbacksDrawbacksOnly applicable to client Windows Only applicable to client Windows applicationsapplications

Security protections can limit application Security protections can limit application capabilitiescapabilities

Must be online to execute, no offline useMust be online to execute, no offline use

No control over download/update processNo control over download/update process

Must resort to workaround approaches to Must resort to workaround approaches to overcome the other drawbacksovercome the other drawbacks

Page 14: Deploy .NET Applications with Ease

Updater Application BlockUpdater Application Block

Auto-updating of installed smart client Auto-updating of installed smart client applications from a deployment serverapplications from a deployment server

ProcessProcessDeploy updates to server with manifestDeploy updates to server with manifest

Run controller on client to monitor for Run controller on client to monitor for changes on serverchanges on server

Controller downloads, validates, and Controller downloads, validates, and optionally post-processes updates optionally post-processes updates

App launcher runs new version on next App launcher runs new version on next app launchapp launch

Page 15: Deploy .NET Applications with Ease

Windows InstallerWindows Installer

Application installation and Application installation and configuration serviceconfiguration service

Manages installation and removal of Manages installation and removal of applicationsapplications

Centrally defined rules and repositoryCentrally defined rules and repository

Provides disaster recovery and Provides disaster recovery and rollback mechanismsrollback mechanisms

Page 16: Deploy .NET Applications with Ease

Windows InstallerWindows Installer

Highly customizable process and Highly customizable process and database of installation steps and database of installation steps and itemsitems

Uses Installer deployment packages Uses Installer deployment packages (.msi files)(.msi files)

Executable format, often called by Executable format, often called by setup.exesetup.exe

Current version 2.0Current version 2.0Supported OS: Win 95, 98, ME, NT4, 2KSupported OS: Win 95, 98, ME, NT4, 2K

Part of WinXP, Server 2003Part of WinXP, Server 2003

Page 17: Deploy .NET Applications with Ease

Setup and Deployment ProjectsSetup and Deployment Projects

Built-in project types in Visual Studio.NETBuilt-in project types in Visual Studio.NET

Creates a Windows Installer package (.msi Creates a Windows Installer package (.msi file)file)

Integrates with deployed project through Integrates with deployed project through VS.NET solutionsVS.NET solutions

Fine grained control of installation stepsFine grained control of installation steps

Supports Authenticode certificate signingSupports Authenticode certificate signing

Need to have .NET Framework on target Need to have .NET Framework on target machinemachine

Page 18: Deploy .NET Applications with Ease

Setup and Deployment Project TypesSetup and Deployment Project Types

Page 19: Deploy .NET Applications with Ease

Customizing Setup ProjectsCustomizing Setup Projects

Fine Grained Setup OptionsFine Grained Setup OptionsFile System EditorFile System Editor

Registry EditorRegistry Editor

File Types EditorFile Types Editor

User Interface EditorUser Interface Editor

Custom Actions EditorCustom Actions Editor

Launch Conditions EditorLaunch Conditions Editor

Page 20: Deploy .NET Applications with Ease

WinForms WinForms DeploymentDeploymentBrian NoyesBrian NoyesIDesign, Inc.IDesign, Inc.www.idesign.net

Page 21: Deploy .NET Applications with Ease

Capturing User InputCapturing User Input

Pre-defined dialogsPre-defined dialogsAssign variable names to input controlsAssign variable names to input controls

Can pass variables to custom steps or Can pass variables to custom steps or use in conditionalsuse in conditionals

Custom ActionsCustom ActionsPresent your own dialogs after Present your own dialogs after completion of the canned dialogscompletion of the canned dialogs

Gather input as desiredGather input as desired

Page 22: Deploy .NET Applications with Ease

Defining Custom ActionsDefining Custom Actions

Custom actions only executed after Custom actions only executed after setup project stepssetup project steps

Action typesAction typesExecutables (*.exe,*.dll))Executables (*.exe,*.dll))

Scripts (*.vbs, *.js)Scripts (*.vbs, *.js)

Page 23: Deploy .NET Applications with Ease

ASP.NET Web ASP.NET Web Application DeploymentApplication DeploymentBrian NoyesBrian NoyesIDesign, Inc.IDesign, Inc.www.idesign.net

Page 24: Deploy .NET Applications with Ease

Creating Managed InstallersCreating Managed Installers

Derive from Installer base classDerive from Installer base classSystem.Configuration.InstallSystem.Configuration.Install

Apply [RunInstaller(true)] attributeApply [RunInstaller(true)] attribute

Place in class library assemblyPlace in class library assembly

Either:Either:Add to custom actionAdd to custom action

Run InstallUtil.exeRun InstallUtil.exe

Page 25: Deploy .NET Applications with Ease

Handling ErrorsHandling Errors

Rollback methodRollback methodCall during the Install phase if an error Call during the Install phase if an error occursoccurs

InstallExceptionInstallExceptionThrow during the commit, rollback, or Throw during the commit, rollback, or uninstall phases if an error occursuninstall phases if an error occurs

Page 26: Deploy .NET Applications with Ease

Managed InstallerManaged InstallerBrian NoyesBrian NoyesIDesign, Inc.IDesign, Inc.www.idesign.net

Page 27: Deploy .NET Applications with Ease

SummarySummary

Multiple deployment modelsMultiple deployment modelsSmart Client options evolvingSmart Client options evolvingEasy to support complex installation Easy to support complex installation requirements with Setup and Deployment requirements with Setup and Deployment ProjectsProjects

Support managed and unmanaged project Support managed and unmanaged project installationinstallation

Can create custom managed installers Can create custom managed installers with .NETwith .NETChoose the minimum impact install possibleChoose the minimum impact install possiblePlan for deployment early in requirements Plan for deployment early in requirements analysis and design processanalysis and design process

Page 28: Deploy .NET Applications with Ease

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

Updater Application BlockUpdater Application Blockhttp://msdn.microsoft.com/library/en-us/dnbda/html/updater.asphttp://msdn.microsoft.com/library/en-us/dnbda/html/updater.asp

ClickOnce DeploymentClickOnce Deployment.NET Rocks! Interview.NET Rocks! Interviewhttp://www.franklins.net/fnetdotnetrocks/dotnetrocks.aspx?showid=48http://www.franklins.net/fnetdotnetrocks/dotnetrocks.aspx?showid=48Deploy and Update Your Smart Client Projects Using A Central Server, Brian Deploy and Update Your Smart Client Projects Using A Central Server, Brian Noyes, MSDN Magazine, May 2004Noyes, MSDN Magazine, May 2004http://www.msdn.microsoft.com/msdnmag/issues/04/05/ClickOnce/default.aspxhttp://www.msdn.microsoft.com/msdnmag/issues/04/05/ClickOnce/default.aspx

Microsoft Installer SDKMicrosoft Installer SDKhttp://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/http://msdn.microsoft.com/library/default.asp?url=/library/en-us/msi/setup/windows_installer_start_page.aspwindows_installer_start_page.asp

Page 29: Deploy .NET Applications with Ease

Q1:Q1: Overall satisfaction with the sessionOverall satisfaction with the session

Q2:Q2: Usefulness of the informationUsefulness of the information

Q3:Q3: Presenter’s knowledge of the subjectPresenter’s knowledge of the subject

Q4:Q4: Presenter’s presentation skillsPresenter’s presentation skills

Q5:Q5: Effectiveness of the presentationEffectiveness of the presentation

Please fill out a session evaluation on CommNetPlease fill out a session evaluation on CommNet