Case 1: Small Errors

 

Overview

Once a group of computer programmers has finished creating a series of executable programs and grouped them under the umbrella of a top-level entry program (as in Chapter 23), it is time to write the code that will transfer those programs to a customer s PC hard drive as a suite of programs that is invoked by the click of an icon (shortcut) on the desktop. The purpose of this chapter is to discuss how this deployment program is created and some of the issues confronted at that time.

Most installation programs transfer three kinds of files from the delivery vehicle (usually a CD) to the customer s hard drive: executables, data files necessary for internal bookkeeping, and read-only files (such as helps). In this demonstration, a deployment suite named KT101 is developed to transfer executable and bookkeeping files to the C:\Program Files\KT101 subdirectory. There are no help files included. An icon (shortcut) is placed on the PC desktop to invoke the KT101 suite, which consists of seven executables and five bookkeeping files (*.dta). The shortcut placed on the desktop opens one of the seven executables, KT101EntryPoint, and KT101EntryPoint opens the other six executables in turn .

If this demonstration becomes too tedious , there is a completed deployment program installed from the companion files in C:\Documents and Settings\Owner\My Documents\Visual Studio 2005\Projects\ KT101\KT101DeploymentDemoSpare. The completed deployment program s executable, KT101DeploymentDemoSpare.msi, is located at KT101DeploymentDemoSpare\KT101DeploymentDemoSpare\Debug.

With the advent of the Setup and Deployment specialty project capability built into the C# v2.0 compiler, there is no need any longer to use one s manual deployment schemes, such as was used with the C++ language. There is one big difference with the automated C# Setup and Deployment project and the old manual deployment programs that we designed in the past: The automated C# project places all the files and folders that are placed in the deployment project into the PC s registry, while the manual deployment schemes never used the registry. Therefore, the manual deployment schemes were difficult to remove at a later date.

During the construct of the modern, automatic Setup and Deployment project, the programmer is required to drag and drop every file and folder that is to be deployed by the new project. This is not hard to do. The automatic project does not physically move each file and folder to itself; it stores a path to each element instead (in a small database). The file/folder is copied to the deployment program only when the programmer clicks on the Build | Build Solution menu item (the last step in the process).

Since the automatic project brings all the files and folders to itself and copies them into the output file (*.msi) at project build time, this output file is huge (several megs in size is not unusual).

The automatic project requires that the programmer name the entry point into the group of programs as a primary output of the project itself. There again, this is not difficult to do, but the programmer must keep her thinking cap on at all times. This is tedious work.

 


Unlocking Microsoft C# V 2.0 Programming Secrets
Unlocking Microsoft C# V 2.0 Programming Secrets (Wordware Applications Library)
ISBN: 1556220979
EAN: 2147483647
Year: 2005
Pages: 129

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