1 / 43

Building on the .Net Framework

Building on the .Net Framework. Distributing the Smart Client Application. Microsoft Code Camp II October 16, 2004. Andrew Novick. Agenda. History of Software Distribution .Net Distribution Options XCOPY, No Touch, Updater Application Block Technologies Setup Projects Merge Modules

Download Presentation

Building on the .Net Framework

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Building on the .Net Framework Distributing the Smart Client Application Microsoft Code Camp II October 16, 2004 Andrew Novick

  2. Agenda • History of Software Distribution • .Net Distribution Options • XCOPY, No Touch, Updater Application Block • Technologies • Setup Projects • Merge Modules • Strong Names • Updater Application Block. Distributing the Smart Client Andrew Novick

  3. Novick Software • The consulting company of Andrew Novick • Business Applications • Design – Programming - Project ManagementCoaching - Training • SQL Server, VB, C#, VB.Net, ASP.Net, XML • http://www.NovickSoftware.comHome of the Transact-SQL User-Defined Function of the Week Distributing the Smart Client Andrew Novick

  4. Distributing the Smart Client ApplicationGoals: • Distribute the application and its components to the client with the minimum effort on the part of: • Support staff • End users • Development staff Distributing the Smart Client Andrew Novick

  5. Deployment Circa 1990 REM Load PImage to a workstation C: mkdir PImage cd pimage XCOPY a:\*.* Distributing the Smart Client Andrew Novick

  6. Deployment 1995-2002 DLL Distributing the Smart Client Andrew Novick

  7. Software Solutions • Microsoft System Management Server (SMS) • Microsoft Software Update Service (SUS) • Trivoli • Active Directory - Group Policy • Others…. Distributing the Smart Client Andrew Novick

  8. What Hath .Net Wrought? • Distribution is easier. • Multiple Versions of a component can run side by side. • Global Assembly Cache (GAC) stores shared components • Windows Installer still necessary Distributing the Smart Client Andrew Novick

  9. Strong Names • Strong names can be necessary. • Create a .SNK file using the SN tool in • …Visual Studio 2003\SDK\v1.1\bin • Reference the SNK file in every assembly • Using Interop requires extra steps Distributing the Smart Client Andrew Novick

  10. Strong Names • Guarantee Name Uniqueness • Subsequent versions must be built with the same key file. • Insure that the contents of the assembly file have not been changed since it was producted. Distributing the Smart Client Andrew Novick

  11. GAC • Sound made by a cat when coughing up a hair ball. • Global Assembly Cache • Located in c:\Windows\assembly • Will hold multiple versions of an assembly • Requires Strong Name on all assemblies • Requires Administrator privilege to install Distributing the Smart Client Andrew Novick

  12. Searching for an Assembly • The GAC is searched first! • The default location is where the code is running. • App.Config <codebase> can override the default location Distributing the Smart Client Andrew Novick

  13. Deployment - Requirements • Install COM components • Install Components into the GAC • Create Event Logs • Allow for offline work • Update automatically, even when the application is in use. • Force update when on-line Distributing the Smart Client Andrew Novick

  14. Deployment - Choices • XCOPY • MSI • No-Touch Deployment • No-Touch with NetRun • Updater Application Block (UAB) Distributing the Smart Client Andrew Novick

  15. Deployment Dimensions Distributing the Smart Client Andrew Novick

  16. First Install • How is the 1st install done on each client? • Does it require a setup program to be run? • Can it be deployed some other way? • Preference for automatic install. Distributing the Smart Client Andrew Novick

  17. Updates • How are updates installed? • Is a revised setup required? • Some form of automatic distribution? • Preference is for automatic distribution. Distributing the Smart Client Andrew Novick

  18. Offline • Does the method support working disconnected? • Preference depends on the application.My application requires working offline. Distributing the Smart Client Andrew Novick

  19. Security • What are the security requirements? • Code Access Security (CAS) plays a role. • Sandbox – Code must conform to rules • Full Trust – Code can do anything • Preference varies by application • Full Trust is the easiest to code Distributing the Smart Client Andrew Novick

  20. App.Config • Can an App.Config file be used? • This is always possible. • Are the changes to security settings acceptable? • Preference is for an App.Config Distributing the Smart Client Andrew Novick

  21. COM • Can COM objects be deployed? • How are they registered. • Do we go back to DLL Hell? • Preference depends on the application’s requirements for COM objects. Distributing the Smart Client Andrew Novick

  22. GAC • Can code be installed in the GAC? • Example Infragistics Windows Controls • 10 Megabytes • 5 applications • 4 Versions of each application • = 200 Megabytes if not stored in the GAC • Preference is to put large assemblies that are used by multiple applications and which don’t change into the GAC. Distributing the Smart Client Andrew Novick

  23. Other Files • Can other files be distributed? • Examples • Pictures, databases, • Anti-virus applications may interfere with distribution of vbs, exe, dll, etc.. • Preference is yes. There are always a way to distribute them. Distributing the Smart Client Andrew Novick

  24. Deployment - Analysis Distributing the Smart Client Andrew Novick

  25. XCOPY • Deployment the DOS 4.0 way Distributing the Smart Client Andrew Novick

  26. XCOPY • Works for simple applications • Manual • No Com • No GAC Distributing the Smart Client Andrew Novick

  27. MSI – Setup Project • Visual Studio Setup Project • Creates a Windows Installer MSI file. Distributing the Smart Client Andrew Novick

  28. MSI – Setup Projects • Visual Studio Setup Projects • Create MSI • Installed by Windows Installer • Manual installation required! Distributing the Smart Client Andrew Novick

  29. MSI – Setup Capabilities • Install files into multiple locations • Customizable Screens made with .Net WinForms • Can deploy assemblies into the GAC • Can register COM objects • Can deploy .Net Framework and MSDE • Can include .Net Installation Components Distributing the Smart Client Andrew Novick

  30. Installation Components • Code to perform these tasks: • Create Event Logs • Create MSMQ Queues • Create Databases • Create Performance Counters • Create Windows Services Distributing the Smart Client Andrew Novick

  31. No Touch Deployment • Deploy from IIS Virtual Directory Distributing the Smart Client Andrew Novick

  32. No Touch Deployment • Automatic update of applications via the web. • Application runs in the CAS sandbox. • No disk I/O except Isolated Storage • May only communicate with the site of origin • Restrictions • No COM • No GAC • No App.Config • No non-code files Distributing the Smart Client Andrew Novick

  33. No Touch Deployment with Net Run • Deploy from IIS Virtual Directory Distributing the Smart Client Andrew Novick

  34. Net Run • From Rocky Lhotka’s book:Expert One-on-One Visual Basic Business Objects • NetRun is a WinForms application which is started by a short cut on the client machine. • It runs with Full Trust • It creates an AppDomain and loads the target executable into the AppDomain and starts it. Distributing the Smart Client Andrew Novick

  35. No Touch with NetRun • Requires one-time installation for NetRun and any shortcuts. • Shortcuts point to the NetRun application. • Command line parms tell NetRun where to get the application. • NetRun has FullTrust • it creates an AppDomain • Starts the target app in that AppDomain • The target app has full trust. Distributing the Smart Client Andrew Novick

  36. Updater Application Block • Code based solution from Microsoft Patterns & Practices Distributing the Smart Client Andrew Novick

  37. Updater Application Block (UAB) • Free code from Microsoft Patterns and Practices • Must do the initial install via MSI • COM Okay • GAC Okay • Moderately complex to implement. • Allows • Automatic Update • App.Config • Other Files Distributing the Smart Client Andrew Novick

  38. Alternative Automatic Updating Solutions • No reason that you can’t write your own. • There may be other commercial solutions. Distributing the Smart Client Andrew Novick

  39. Deployment - Choice • Initial MSI • COM install • Crystal component install • Installer project to create event log • Merge Module for Infragistics • Updater Application Block • Downloads and applies updates when they become available (5 min lag) • The implementation can force a the user to wait for a download during application startup. • Using BITS downloader. Distributing the Smart Client Andrew Novick

  40. BITS 2.0 – Oooops! • BITS 2.0 Breaks existing UAB code! • There is a registry change to turn off the extra security checking. • There is an unsupported fix to the code in C# Distributing the Smart Client Andrew Novick

  41. Detect BITS 2.0 Installation • HKEY_LOCAL_MACHINE • \Software\Microsoft\Windows NT\CurrentVersion\Hotfix\KB84277 • Windows XP Service Pack 2 also installs it. Distributing the Smart Client Andrew Novick

  42. Registry Fix for BITS 2.0 Issue • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\BITS • Add DWORD UseLmCompat with value 0 Distributing the Smart Client Andrew Novick

  43. Thanks for Coming • Please send feedback to: anovick@novicksoftware.com www.NovickSoftware.com Distributing the Smart Client Andrew Novick

More Related