Windows Installer


You can also create a Windows installer program to install the Web application. Creating installation programs is required if shared assemblies are needed by the Web application. Also, using installation programs has the advantage that the virtual directory is configured with IIS, and you're not required to create a virtual directory manually. The person installing the Web application can start a setup.exe program, and the complete setup is done automatically. Of course, administrative privileges are required to start this program.

Note

Shared assemblies are discussed in Chapter 26.

Creating a Setup Program

Visual Studio 2005 ships with the project type Web Setup Project to create installation programs for Web applications. With the Web Setup Project, the following editors are available: File System, Registry, File Types, User Interface, and Custom Action and Launch Conditions. Not all these editors will be discussed here — this already has been done in Chapter 17 with Windows applications. Only the tasks needed for Web applications are shown.

In the next Try It Out, you create a setup program that installs a Web application.

Try It Out – Create a Setup Program

image from book
  1. Open the Web application from Chapter 19 using Visual Studio 2005.

  2. Add a new project of type Web Setup Project, as shown in Figure 21-12. Name the project EventRegistrationWeb. Click the OK button.

    image from book
    Figure 21-12

  3. After you click the OK button, the file system editor is displayed. Select File System on Target Machine, and select the menu Project Add Project Output. From the Project Output dialog, select Content Files of the Web application and click the OK button.

  4. In the file system editor, select Web Application Folder. You can now configure the Web application with the properties editor. The table below shows the properties and their descriptions.

    Web Application Folder Property

    Description

    AllowDirectoryBrowsing

    AllowDirectoryBrowsing is one of the options discussed in the IIS configuration section earlier in the chapter (see Figure 21-7). Setting this option to true allows browsing for files on the Website. The default value is false.

    AllowReadAccess

    This option is set by default to true. To access ASPX pages, read access is required.

    AllowScriptSourceAccess

    By default, script source access is denied with the AllowScriptSourceAccess property set to false.

    AllowWriteAccess

    Write access is denied by default.

    DefaultDocument

    The DefaultDocument property sets the home page of the Website, for example Default.aspx.

    ExecutePermissions

    The default value of ExecutePermissions is set to vsdepScriptsOnly, which allows access to ASP.NET pages, but does not allow custom executables to run on the server. If custom executables should be allowed to run on the server, this option can be set to vsdepScriptsAndExecutables.

    LogVisits

    With LogVisits set to true, client access logging is configured.

    VirtualDirectory

    With this property, you can set the name of the virtual directory that is configured with IIS.

  5. Open the Launch Conditions editor with the menu View Editor Launch Conditions. Launch conditions define what products must be installed on the target system before the installation can be done.

  6. Check the launch conditions that are configured. The Search for IIS configuration verifies if IIS is installed on the target system by checking the registry key SYSTEM\CurrentControlSet\ Services\W3SVC\Parameters to get the IIS version. The launch condition IIS Condition checks that the IIS version is at least 4. For ASP.NET 2.0 Web applications, you can change this value to 5 to require at least IIS 5.

  7. Build the setup application by selecting the menu Build Build EventRegistrationWebSetup.

  8. In the directory of the setup project you will find the setup.exe file and an installation package named EventRegistrationWebSetup.msi.

image from book

Installing the Web Application

By starting the setup.exe program, you can install the Web application.

Try It Out – Installing a Web Application

image from book
  1. Click setup.exe to start installing the Web application. The Web Setup Wizard will display the dialog shown in Figure 21-13.

    image from book
    Figure 21-13

  2. Click the Next button. With the second dialog (see Figure 21-14) you can select the installation address. Rename the Virtual directory to a name that's not already configured with IIS.

    image from book
    Figure 21-14

  3. Click the Next button. At the Confirm Installation dialog, you can confirm the installation by clicking the Next button (see Figure 21-15).

    image from book
    Figure 21-15

  4. While the installation is running, a progress bar is shown (see Figure 21-16).

    image from book
    Figure 21-16

  5. After a successful installation, you see the Installation Complete dialog (see Figure 21-17). Click the Close button.

    image from book
    Figure 21-17

  6. Now you can start the Website from the new virtual directory.

image from book




Beginning Visual C# 2005
Beginning Visual C#supAND#174;/sup 2005
ISBN: B000N7ETVG
EAN: N/A
Year: 2005
Pages: 278

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