Deployment Techniques


You can deploy a Visual Basic .NET application or component in a number of ways, such as XCopy, no-touch, Windows Installer, or a cabinet-file installation. The Windows Installer and cabinet-file installation techniques are traditional deployment technologies that can be used for Microsoft Windows .NET and traditional Windows applications and components (such as ActiveX controls). XCopy and no-touch deployment techniques are new to Visual Basic .NET.

XCopy Deployment

XCopy deployment gets its name from the command-line tool XCopy.exe. XCopy deployment is a means of recursively copying a directory containing an application (and all subdirectories contained within the directory) to a location where the application will be run. .NET makes XCopy deployment possible because .NET applications and components typically do not require any special registration—unlike ActiveX components—in order to run. If your Visual Basic .NET application is composed entirely of .NET components—or in other words, is void of ActiveX components—XCopy deployment might be an option for you. XCopy deployment generally works best for ASP.NET Web applications and Web services applications where you copy the application from the development computer to the target Web server computer. When copying a Visual Basic .NET application from one computer to another using this technique, you should preserve the following file information:

  • File attributes such as read-only, hidden, system, and so forth. If using XCopy.exe, use the /K option to preserve file and folder attributes, the /R option to enable replacement of read-only files (on the destination computer), and the /H option to copy hidden and system files.

  • Windows security-related permission ACLs for all files and folders being copied. If using XCopy.exe, use the /O option to preserve ACL permissions.

No-Touch Deployment

This technique involves making your Visual Basic .NET Windows Forms application or component available for direct execution from a Web page—actually the application and associated components are copied from the Internet (or intranet, depending on the location of the Web page) to a special Internet download cache on your computer, and they are run from there. Benefits of using no-touch deployment include:

  • A centralized deployment model is provided for Windows Forms applications and components, where all clients are automatically updated with the most recent version of the application or component deployed on a Web server.

  • The application or component is assigned .NET code-access security permissions based on the security zone where it was downloaded from, as described in Chapter 3.

For general information on no-touch deployment, refer to the following links:

  • http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vstechart/html/vbtchNo-TouchDeploymentInNETFramework.asp

  • http://msdn.microsoft.com/msdnmag/issues/02/01/UserCtrl/default.aspx

For more information on how to deploy Windows Forms user-controls by means of no-touch deployment, refer to the following link: http://www.gotdotnet.com/team/windowsforms/iesourcing.aspx.

Windows Installer Deployment

You can use a variety of tools, including the Microsoft Visual Studio .NET Deployment Wizard to create a Windows Installer (.MSI) deployment package. A Windows Installer package is a full-featured setup allowing you to include a user interface (UI) that allows the user to specify installation options such as the application features to install and the directory location where the application files will be installed. You should deploy your application in a Windows Installer package if your application has any of the following requirements:

  • Choice of features to install for the user to pick from

  • Application directory location determined by the user

  • Registration of any ActiveX or .NET components

  • Installation of system-style .NET .DLL components (assemblies) to the global assembly cache (GAC)

  • Desktop shortcuts or Start menu items

  • Reboot as part of installation required to replace a file in use by the operating system

  • Disabling a Windows operating system service required to install a component

Another use of the Windows Installer package is to bundle up .NET code- access security permissions to be distributed with your Windows Forms application. In this case, your customer first installs the security policy updates— your customer will need to be logged on as an administrator of her computer to install policy changes on it. The Windows Forms application or component requiring the security policy updates can be deployed in a separate Windows Installer .MSI file or by using the no-touch deployment technique described previously.

Cabinet-File Deployment

Cabinet files (.CAB) are typically used as a means of distributing ActiveX components on the Internet. .CAB files use the same underlying technology as Windows Installer files, but .CAB files typically don’t show any UI. If you want to include an ActiveX component on a Web page, consider using a .CAB file to deploy the component. In the case of .NET components you want to include on a Web page, you should use no-touch deployment (discussed previously) instead.

For more information on cabinet-file deployment, see the following link: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon98/html/vbconhowinternetcomponentdownloadworks.asp .

Table 10-1 provides a summary of the deployment techniques available, along with advice on when to use each one.

Table 10-1: Deployment Techniques and When to Use Them_ (continued)

Deployment Technique

Use When

Notes

XCopy

Application is an ASP.NET or Web service deployed to a Web server.

  • No sophisticated installation package is required to distribute a Web application to a Web server.

  • The destination Internet Information Services (IIS) server does not need to be stopped to copy new .NET components to the Web server.

No touch

  • Application or component is a Windows Forms application or component (such as a user control) deployed to the Internet.

  • Windows Forms application or component is designed to automatically download dependent components—by calling Assembly.LoadFrom and passing a URL address—from the Internet when needed.

  • Requires no packaging. .NET .EXE and .DLL application components are referenced directly by a link on a Web page.

  • A Windows Forms application that dynamically downloads Windows Forms components requires an Internet connection to always be present when the application runs.

  • All client computers automatically receive the latest version of the Windows Forms application when it becomes available.

  • Allows you to deploy Windows Forms applications from a central Web server location.

Windows Installer (.MSI)

  • Application contains ActiveX or .NET components requiring special registration.

  • .NET code-access security policy permissions for the application need to be added.

  • Reboot is needed as part of installation.

  • Locked files need to be replaced during installation (requiring operating system services to be stopped and started).

  • Configuration settings, such as NTFS security, need to be added.

  • Desktop shortcuts or menus need to be created.

  • Application contains optional components or features the user can pick from.

  • Provides a mechanism for distributing .NET code- access security policy updates for your no-touch, Windows Installer, or cabinet-file deployed application.

  • The form of deployment most often used for traditional deployment mechanisms such as shrink- wrapped software.

  • .MSIs can be deployed on the Internet, but no code-access security protection is provided to the software after it is installed from the Internet.

  • Type of deployment used to distribute Visual Studio .NET.

Cabinet file (.CAB)

ActiveX or .NET component is deployed on Internet for use on a Web page.

If a .NET component is included in the .CAB, the deployment works much like no-touch deployment.




Security for Microsoft Visual Basic  .NET
Security for Microsoft Visual Basic .NET
ISBN: 735619190
EAN: N/A
Year: 2003
Pages: 168

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net