XCopy Deployment

Team Fly 

Page 245

with the user's environment (create shortcuts, add entries to the Registry, request product registration, and so on). Programs installed through Windows installer can later be removed through the Add Or Remove Programs snap-in of the Control Panel.

XCopy Deployment

Once the .NET Framework runtime has been installed on a client computer, you can deploy an application by copying its files to the client computer. Simple applications consist of just an EXE file. Large applications may contain DLL files with custom components. The good news is that you don't have to register the DLLs and worry about versions. The DLLs are copied along with the EXE and you can have different versions of the same DLL running side-by-side. Different versions of the same DLL reside in different folders, along with the version of the application that uses them. You can even install different versions of a DLL in the GAC, where applications look for a DLL if it's not in their path.

This type of deployment is called XCopy deployment, because the application is installed on the target machine by simply copying the files in the application's Bin folder (and any subfolders with custom files that may exist in this folder) to the target computer. No components are registered and no changes are made to the target computer's file system. To remove the application, you simply delete the folder and no trace of the application will remain on the computer—except perhaps for a shortcut the user may have created on the desktop. You can also install multiple versions of the same application, which can run side-by-side. Each application folder contains its own DLLs and dependencies and they won't interfere with one another. The fact that DLLs are treated as application files and need not be registered at the client computer may bring an end to the situation known in pre.NET days as DLL hell.

If a component is going to be used by multiple applications, we usually place it in the GAC. To install a DLL in the GAC, open a Command Prompt window, switch to the folder that contains the DLL, and execute the following statement:

 cagutil -i component.dll 

To uninstall the same component, call the cagutil with the -u argument. When using XCopy deployment, it's a good idea to avoid the GAC, because you must remember to install the new version of each component to each client's CAG. If you decide to create an installer package to distribute your application, you can automatically install components to the GAC from within the installation project.

As convenient as this method of deployment may sound, it's not flexible at all, and can't be used with anything but the simplest projects. You can't even create a shortcut on the target computer's desktop; users will have to do so manually. If your application needs to install a component at the GAC, or install a new font to the target computer, then you can't use this deployment method. You must resort to a setup project that will install the application to the target computer and perform custom actions.

XCopy deployment eliminates the update problems as well. To deploy a newer version on the client machine, just copy the new files over the existing ones. The next time the user on this client runs the application, they will see the new version of the application. Of course, if you copy the files to a different folder, both versions of the application will coexist on the client.

Team Fly 


Visual Basic  .NET Power Tools
Visual Basic .NET Power Tools
ISBN: 0782142427
EAN: 2147483647
Year: 2003
Pages: 178

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