1. Trang chủ
  2. » Công Nghệ Thông Tin

Professional ASP.NET 3.5 in C# and Visual Basic Part 159 ppt

10 190 0
Tài liệu đã được kiểm tra trùng lặp

Đang tải... (xem toàn văn)

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 10
Dung lượng 375,33 KB

Các công cụ chuyển đổi và chỉnh sửa cho tài liệu này

Nội dung

Evjen c34.tex V1 - 01/28/2008 4:20pm Page 1546Chapter 34: Packaging and Deploying ASP.NET Applications Figure 34-15 This screen tells you what you are installing the Default Web Site as

Trang 1

Evjen c34.tex V1 - 01/28/2008 4:20pm Page 1546

Chapter 34: Packaging and Deploying ASP.NET Applications

Figure 34-15

This screen tells you what you are installing (the Default Web Site) as well as the name of the virtual

directory created for the deployed Web application The consumer can feel free to change the name of

the virtual directory in the provided text box A button in this dialog allows for an estimation of the disk

cost (space required) for the installed application In NET 3.5, the installer also allows the end user to

choose the application pool he or she is interested in using for the application The next series of screens

install theWebSetup1application (shown in Figure 34-17)

After the application is installed, you can find theWebSetup1folder and application files located in the

C:\Inetpub\wwwrootfolder (within IIS) The application can now be run on the server from this location

Uninstalling the Application

To uninstall the application, the consumer has a couple of options First, he can relaunch the.msifile and

use the option to either repair the current installation or to remove the installation altogether (as shown

in Figure 34-18)

The other option is to pull up the Add/Remove Programs dialog from the server’s Control Panel On the

Control Panel, you seeWebSetup1listed (as shown in Figure 34-19)

This dialog holds information about the size of the installed application and, if you are using Windows

XP, it will also show you how often the application is used Also, if you are using Windows XP, clicking

Trang 2

Evjen c34.tex V1 - 01/28/2008 4:20pm Page 1547

Chapter 34: Packaging and Deploying ASP.NET Applications

Figure 34-16

the support link pulls up the Support Info dialog, which shows the project’s properties that you entered

a little earlier (see Figure 34-20)

However, if you are using Windows Vista, you can get at the same information by right-clicking on the column headers and selecting the More option from the provided menu This gives you a list of options (shown here in Figure 34-21), providing the same information as what you can see in Windows XP

From the Add/Remove Programs dialog, you can remove the installation by clicking the Remove button

of the selected program

Looking More Closely at Installer Options

The Windows Installer service easily installs a simple ASP.NET Web application The installer takes care

of packaging the files into a nice.msifile from which it can then be distributed Next, the.msifile takes care of creating a virtual directory and installing the application files The installer also makes it just as

easy to uninstall the application from the server All these great services are provided with very little

work on the user’s part

Trang 3

Evjen c34.tex V1 - 01/28/2008 4:20pm Page 1548

Chapter 34: Packaging and Deploying ASP.NET Applications

Figure 34-17

Figure 34-18

Trang 4

Evjen c34.tex V1 - 01/28/2008 4:20pm Page 1549

Chapter 34: Packaging and Deploying ASP.NET Applications

Figure 34-19

Figure 34-20

Even though this approach addresses almost everything needed for an ASP.NET installer program, the setup and deployment project for Web applications provided by Visual Studio really provides much

more in the way of options and customizations This next section looks at the various ways you can work with modifying the installer program

Trang 5

Evjen c34.tex V1 - 01/28/2008 4:20pm Page 1550

Chapter 34: Packaging and Deploying ASP.NET Applications

Figure 34-21

Working with the Deployment Project Properties

You can work with the project properties of the installer from Visual Studio in several ways The first

way is by right-clicking the installer project from the Solution Explorer of Visual Studio and selecting

Properties from the menu This pulls up the WebSetup1 Properties Pages dialog shown in Figure 34-22

This dialog has some important settings for your installer application Notice that, like other typical

projects, this setup and deployment project allows for different active build configuration settings For

instance, you can have the active build configuration set to either Release or Debug You can also click on

the Configuration Manager button to get access to configuration settings for all the projects involved In

addition, this dialog enables you to add or remove build configurations from the project

The Output File Name

The Output File Name setting lets you set the name of the.msifile that is generated By default, it is the

name of the project, but you can change this value to anything you want This section also allows you to

modify the location where the built.msiis placed on the system after the build process occurs

Trang 6

Evjen c34.tex V1 - 01/28/2008 4:20pm Page 1551

Chapter 34: Packaging and Deploying ASP.NET Applications

Figure 34-22

Package Files

The Package files section of this properties page enables you to specify how the application files are

packaged in the.msifile The available options include the following:

As loose, uncompressed files:This option builds the project so that a resulting.msifile is

created without the required application files Instead, these application files are kept separate

from the.msifile but copied to the same location as the.msifile With this type of structure, you must distribute both the.msifile and the associated application files

In setup file:This option (which is the default option) packages the application files inside the

.msifile This makes distribution an easy task because only a single file is distributed

In cabinet file(s):This option packages all the application files into a number of cabinet files The size of the cabinet files can be controlled through this same dialog (discussed shortly) This is an ideal type of installation process to use if you have to spread the installation application over a

number of DVDs, CDs, or floppy disks

Installation URL

Invariably, the ASP.NET applications you build have some component dependencies In most cases, your application depends on some version of the NET Framework The installation of these dependencies,

or components, can be made part of the overall installation process This process is also referred to as

Trang 7

Evjen c34.tex V1 - 01/28/2008 4:20pm Page 1552

Chapter 34: Packaging and Deploying ASP.NET Applications

bootstrapping Clicking the Prerequisites button next to the Installation URL text box gives you a short list

of available components that are built into Visual Studio in order to bootstrap to the installation program

you are constructing (see Figure 34-23)

Figure 34-23

As you can see from when you first enter this settings dialog, the NET Framework 3.5 and the Windows

Installer 3.1 options are enabled by default, and you check the other components (thereby enabling them)

only if your Web application has some kind of dependency on them

From this dialog, you can also set how the dependent components are downloaded to the server where

the installation is occurring The options include downloading from Microsoft, from the server where the

application originated, or from a defined location (URL) specified in the provided text box

Compression

The Windows Installer service can work with the compression of the application files included in the

build process so that they are optimized for either speed or size You also have the option to turn off all

compression optimizations The default setting is Optimized for Speed

Trang 8

Evjen c34.tex V1 - 01/28/2008 4:20pm Page 1553

Chapter 34: Packaging and Deploying ASP.NET Applications CAB Size

The CAB Size section of the properties page is enabled only if you select In Cabinet File(s) from the

Package Files drop-down list, as explained earlier If this is selected, it is enabled with theUnlimited

radio button selected As you can see from this section, the two settings areUnlimitedandCustom:

❑ Unlimited: This selection means that only a single cabinet file is created The size of this file is

dependent on the size of the collection of application files in the Web application and the type of compression selected

❑ Custom: This selection allows you to break up the installation across multiple cabinet files If the

Customradio button is selected, you can enter the maximum size of the cabinet files allowed

in the provided text box The measure of the number you place in the text box is in kilobytes

(KB)

Additional Properties

You learned one place where you can apply settings to the installer program; however, at another place in Visual Studio you can find even more properties pertaining to the entire installer program By selecting theWebSetup1installer program in the Solution Explorer, you can work with the installer properties

directly from the Properties window of Visual Studio The following table lists the properties that appear

in the Properties window

Property Description

Programs dialog found through the system’s Control Panel

company or individual

DetectNewerInstalledVersion Instructs the installer to make a check on the installation server

if a newer version of the application is present If one is present, the installation is aborted The default setting isTrue

(meaning that the check will be made)

installer

interface An example setting isEnglish (United States)

installer program

installer program

Trang 9

Evjen c34.tex V1 - 01/28/2008 4:20pm Page 1554

Chapter 34: Packaging and Deploying ASP.NET Applications

Property Description

application An example value is {885D2E86-6247-4624-9DB1-50790E3856B4}

the application should be uninstalled prior to installing the fresh version The default setting isFalse

stopped and restarted for the installation process The default value isFalse

isOn successful build The other possible value isAlways

merge modules on the development machine

application

program

the installed application

includex86,x64, andItanium

build An example value is {A71833C7-3B76-4083-9D34-F074A4FFF544}

merge module An example value is1.0.1

The following sections look at the various editors provided to help you build and customize the

construc-tion of the installer You can get at these editors by clicking the appropriate icon in the Soluconstruc-tion Explorer

in Visual Studio or by choosing View ➪ Editor in the Visual Studio menu These editors are explained

next

The File System Editor

The first editor that comes up when you create your installer program is the File System Editor The File

System Editor enables you to add folders and files that are to be installed on the destination server In

addition to installing folders and files, it also facilitates the creation of shortcuts This editor is shown

in Figure 34-24

Trang 10

Evjen c34.tex V1 - 01/28/2008 4:20pm Page 1555

Chapter 34: Packaging and Deploying ASP.NET Applications

Figure 34-24

The File System Editor has two sections The left section is the list of folders to be installed during the

installation process By default, only the Web Application Folder is shown Highlighting this folder, or

one of the other folders, gives you a list of properties for that folder in the Properties window of Visual Studio The following table details some of the properties you might find in the Properties window

Property Description

AllowDirectoryBrowsing Allows browsing of the selected directory in IIS The default

value isFalse

The default value isTrue

AllowScriptSourceAccess Specifies the script source access of the selected folder The

default value isFalse

The default value isFalse

ApplicationProtection Defines the IIS Application Protection property for the selected

folder Possible values includevsdapLow,vsdapMedium, and

vsdapHigh The default value isvsdapMedium

selected folder

default value isDefault.aspx

includevsdepNone,vsdepScriptsOnly, vsdepScriptsAnd-Executables The default value isvsdepScriptsOnly

folder The default value isTrue

installed application The default value isTrue

Ngày đăng: 05/07/2014, 19:20

TỪ KHÓA LIÊN QUAN