Deploying Web Applications
This section details how to create an installer to distribute a simple reporting application. We won't cover the steps in much detail here, as most of the information is the same as for Windows applications; so if you have jumped straight to this part of the chapter, then please refer to Deploying Windows Applications above to fill in the details.
Preparing Your Web Server
Before you can install a new web application, the web server you are installing to needs to have the .NET Framework installed first. Just as with Windows applications, there is no automated way to install this from your setup project, so you will probably have to create a batch file or install it manually.In addition to the .NET Framework, if your web application accesses data from a database or other data source, you will need to install MDAC 2.6 or greater in order for your application to work.
Important
You can download the latest MDAC components from the Microsoft web site at http://www.microsoft.com/data/.
Finally, when exporting directly from Crystal Reports and the Web Forms Viewer, you may need to configure some additional MIME types on your web server to associate a file extension (such as a PDF file) with its "helper" application (in this case, Acrobat32.exe).
NoteFor more information on configuring MIME types for your version of IIS, visit the MSDN library at http://msdn.microsoft.com and search for "MIME".
Creating the Setup Project
Firstly, just as in the section on Windows deployment, we need a simple web reporting application to deploy and one has been included for you in the downloadable files for this chapter, in a project named ch10_web_app. This application consists of a single Web Form that has the web version of the Crystal Report Viewer embedded and allows you to preview the same Employee Listing report that we looked at when working with the sample Windows application earlier.

Again we need a Setup Project for this web application - as before, we have already added this to our sample project - called ch10_web_setup.
If you need to set some basic properties for your setup project - click on the name of your setup project, and select View | Properties Window, which will open the property pages.There are a number of properties available; the most commonly used ones are the same as for Windows applications, except for Restart WWW Service that controls whether or not the WWW Service for IIS will be restarted when you install your web application. Whether this option is required or not is up to you and the requirements of the components you are installing on the web server itself.
After this, you will need to consider selecting the Project Outputs, determining Runtime File Requirements, and adding Merge Modules, following the instructions in the Deploying Windows Applications section. While these have already been done for this example, you should know about them for your future projects.
Next we will consider licensing. In order to successfully distribute your applications, you are going to need to first register with Crystal Decisions and obtain a registration number, as we covered in the section on Windows Applications.Again, just like when deploying Windows Applications, this is one of the most common errors when deploying applications that use Crystal Reports, so don't forget to do it every time!
Building your Setup Project
To build your setup, select Build | Build ch10_web_setup.The default Project Configuration is Debug and Projectname is the name of the deployment project - in our instance, the directory would be ch10_web_setup\Debug\ch10_web_setup.msi.
As we saw when we built our Windows application setup, there are also some additional files that have been generated along with the .msi file, which will be in the same directory. For more details about these files see Deploying Windows Applications.
Testing and Deploying your Setup
To test your generated deployment package, copy the entire directory to another computer or CD and run the Setup.Exe file.You must have install permissions on the web server you are using in order to run the installer, and in addition, you must also have the correct IIS permissions to create a virtual directory and install this application.
To test your web application setup, you should be able to see where your files were installed on the web server and verify that they are present. Also, the application should appear under the Add/Remove Programs option in the Windows Control Panel.

To test the application itself, open Internet Explorer and type the URL http://ComputerName/ch10_web_app. Make sure that you test the reports themselves, viewing a number of different reports and trying out the features like drill-down, exporting, and so on.
Once you are satisfied that the application is installed and that it and the reports run correctly, you can distribute the setup files within the subdirectory to users as required.