Deployment
As described in Chapter 4, the photo editor portion of Online Photo Shop is meant to be a downloadable tool offered to online customers to prepare their photos before ordering prints. For a proper release of the product to the business, we must offer a solution to deploy the software to its customers. Also, we must address deployment of the online software running on the Web server. |
After talking to the business representative, we add the requirements listed in Table 13.1 to the project. Both requirements are added to the plan of the eleventh iteration of the project. The schedule has been adjusted to allow for two additional days of development time.
13.1.1 Options for Distributing .NET Applications
Microsoft bundles an installation wizard in Visual Studio.NET that makes it easy to create setup programs. The setup program can be configured to install applications directly from the Web without a separate download or uncompressing step. Therefore, we can deploy the photo editor application using this wizard. |
Requirement |
Type |
Summary |
---|---|---|
F:photo_editor_deployment |
Functional |
An online installer for the photo editor shall be provided, which can be linked to any Web page. No manual setup steps involving copying or uncompressing shall be required. |
F:onlinephotoshop_deployment |
Functional |
The software for Online Photo Shop shall be provided on a CD along with installation instructions for system and Web administrators. |
Deployment of the Online Photo Shop application is also fairly simple. All application files are located in the IIS folder OnlinePhotoShop and can simply be copied to the target machine. Installation notes will guide the administrator in setting up the ODBC data source, folders that receive uploaded images, and orders as well as starting up the ASP.NET State service.
13.1.2 Creating a Setup Program
Let's begin by creating the photo editor installer. Start Developer Studio.NET, and create a new project. Select the Setup Wizard template under Setup and Deployment Projects, and name the project Photo Editor (see Figure 13.1). |
Figure 13.1. Setup Project Wizard
On the second page of the wizard, choose Create a Setup for a Windows Application. Then on the next page, add the following files from Chapter 10's bin folder to the Additional Files to Include list:
- Photo Editor Application.exe
- 3DText.dll
- BrightnessPlugIn.dll
- ColorPlugIn.dll
- RedEyePlugIn.dll
- Hawaii.jpg
After you finish the wizard dialog, a project for the setup program is created. This project requires only a few modifications to match our requirement that it be installable directly from a Web page.
Open the project properties, and change the Bootstrapper setting from Windows Installer Bootstrapper to Web Bootstrapper. A bootstrapper is a very small Windows executable that will launch an installation, but it does not contain the installable program itself. The Web location where the installable packages are stored must be given in the next dialog (see Figure 13.2). Because the program will be installed via Internet download, it also makes sense to change the Compression setting to Optimized for Size.
Figure 13.2. Project Settings for the Setup Program
In the File System view, create a shortcut to the photo editor application and add it to the user's Program menu. In this way, users will be able to start the application directly from their Start | Programs menu. Also, reduce the path for the application folder to [ProgramFilesFolder][ProductName] because the photo editor is the only application that is distributed to end customers. In addition, set the AlwaysCreate property of the user's Program menu to True.
You can try the newly created setup routine by building the project and copying the generated files into a download directory, which must be created in the wwwroot folder of IIS. Now the installation should start when you launch the Web address http://localhost/download/setup.exe.
13.1.3 Deploying Web Applications
As mentioned earlier, deploying .NET Web applications is fairly simple. This has not always been the case. Even though old ASP Web applications could simply be copied from one system to another, almost all of those applications somewhat depended on configuration settings read from the system registry. Furthermore, all external components (COM) where required to be globally registered. If you had multiple applications running that depended on a COM object, this object could not be updated for only one application. Matters usually became even worse when an application had to be installed on a Web farm.
.NET applications, however, do not require object registration; they keep the configuration settings in a local XML configuration file (see Chapters 11 and 12) that is located in the Web applications folder. So if you copy the entire folder to a different server, the configuration is automatically duplicated without the need to run any registration scripts. Also, all assemblies used by Online Photo Shop are also located in this folder, and there is no need to register them. So by copying the OnlinePhotoShop folder we deploy the application's Web pages, assemblies, and configuration.
For the proper operation of the Online Photo Shop Web application, however, further setup steps are required:
- Configuring the directory as an IIS application: A new virtual directory must be created. This allows application-specific configuration settings such as the authentication mode.
- Setting up the ODBC data source: The customer database, an Excel spreadsheet for now, needs to be copied to the system and configured as a systemwide ODBC data source.
- ASP.NET State service: Online Photo Shop relies on the ASP.NET State service for session management. This service must be configured to automatically start up when the application runs.
- Finalizing the configuration: The directories that hold image uploads and orders need to be created and configured in the local configuration file. Also, the name of the customer database must be set.
When we negotiated the new requirements for deployment with the customer, it was agreed that no automated setup needs to be created for the installation of the Web server software. Therefore, we need only summarize those setup steps in an installation notes document.
We will package the following on an installation CD: the zipped folder of the Online Photo Shop Web application, a download folder containing the photo editor setup program and installation package, an empty customer database, and the installation notes.
13.1.4 Online Photo Shop Installation Notes
This procedure describes the setup and configuration of the Online Photo Shop application on a Web server.
Prerequisites
The following software needs to be installed on the target computer:
- Microsoft Windows XP Professional Edition, SP1
- Microsoft Internet Information Server (IIS) 6.0
- Microsoft .NET Framework 1.1
Installation
Figure 13.3 shows the installation procedure.
Figure 13.3. Installation Procedure for the Online Photo Shop Application