Features of the ASP.net 6.2 vs.net Web Setup Project
Vs. NET, which is based on the features of Windows Installer, allows us to do the following:
⑴ Read and write registry keys.
⑵ creates a directory on the target server's Windows file system.
⑶ provides a mechanism for registering components.
⑷ provides a mechanism for collecting information from users during installation.
⑸ allows you to set startup conditions, such as checking the user name, computer name, current operating system, installed software, whether the. NET CLR has been installed, and so on.
⑹ allows you to run a custom configuration program or script after the installation is complete.
In the following section, we will learn how to deploy Deploymentexamplewebapp with the Vs.net Web Setup project.
Vii. Creating a Web Setup Project
First we create a Web Installer project in the Deploymentexampleapp asp.net Web Application solution: Select menu "File" → "new" → "project", in the New Project dialog box, specify the project type "Installation and Deployment Project", and specify the template " Web Setup project, as shown in Figure five.
Figure Five
After you create the project, you then add the ASP.net Web application's assembly and content files to the Setup project. Right-click the Deploymentexamplewebappsetup project in Solution Explorer, select menu add → project output, and in the Add Project Output Group dialog box, select Deploymentexamplewebapp in the Project column. Then select "Primary Output" from the list, as shown in Figure six.
Figure Six
After you have joined the project output, add the relevant content files (including. aspx files, graphics files, and so on) to the project. Open the Add Project Output Group dialog box again, this time by selecting "Content Files" from the list, as shown in Figure seven.
Figure Seven
After the primary output and content files have been added to the Web Setup project, Solution Explorer should be class as shown in Figure eight.
Figure Eight
The Properties window of a Web Setup project allows you to set many properties that determine the content and behavior that the Windows Setup file displays when it is run. You can open the Property Settings window in Figure nine by right-clicking Deploymentexamplewebappsetup in Solution Manager and choosing Properties for menu.
Figure Nine
As you can see from Figure IX, the Properties window allows you to set up information such as author, product description, vendor, support phone, and so on, which can be useful for the end user of the application.
Eight, install ASP.net Web application
After you create a Windows installation file (. msi file), it is convenient to install the ASP.net application on the target server, as long as you double-click the. msi file in Windows Explorer, the Installation Wizard starts and guides the user through the installation process. Figure 10 shows the first dialog box displayed during installation.
Figure 10
Click the Next button in the Figure 10 dialog box to see a dialog box in Figure 11 where you can specify which virtual directory to install the Web application to. This is one of the most convenient features of the Vs.net Web Setup project, where virtual directory creation is completely automated and does not require manual manipulation by the user. In the second part of this article, we'll see how to set up special properties for the virtual directory, such as directory security, during the installation process.
Figure 11
In the dialog box in Figure 11, we can click on the "Disk Cost" button to learn about the disk space required to install the Web application. Click "Next" and the dialog box appears in Figure 12, and the wizard asks us to confirm the installation.
Figure 12
If you click Next in the dialog box in Figure 12, the installation operation begins and the application is installed on the Web server. If the application is installed successfully, a dialog box appears in Figure 13.
Figure 13
After you install the application, you can see the asp.net application that you just installed from the Add or Remove Programs window in Control Panel, and we can uninstall the ASP.net Web application that we just installed from here at any time.
Ix. concluding remarks
xcopy and "Copy Project" are good deployment techniques, the main feature is simple, but require some manual operation. They are ideal for simple installation applications, but in some cases we need to perform more complex operations during the installation process, and it is best to use Windows Installer technology to deploy applications. Deploying ASP.net Web applications with Windows Installer has the following benefits:
⑴ if the application installed with Windows Installer is corrupted, you can repair yourself with the repair feature of the Windows Installer package. If other deployment methods are used, the damaged components must be replaced manually.
⑵ when using Windows Installer technology, we can also take advantage of the automatic fallback feature. When the installation process fails, the auto fallback feature not only ensures that the installed components are deleted correctly, but also that the machine can revert to the state before the installer started.
⑶ because Windows Installer saves all installation information with an. msi installation database, it is possible to obtain information such as which files were copied, which registry keys were created.
⑷ if asp.net applications are to be distributed to multiple users (or packaged for sale), a convenient and automated deployment mechanism is essential, and manual operations such as XCOPY deployment are obviously inappropriate. If you use Windows Installer, a mature, powerful installation technology, the entire installation process can be automated, greatly simplifying application deployment.
This section of the article demonstrates various ways to encapsulate and deploy ASP.net Web applications, how to take advantage of Windows Installer technology, and how to create. msi. In the next installment of this article, we'll add a variety of advanced features, such as the Custom Installation dialog box and the order in which it appears, and how to join the registry key, create a custom folder, and so on, based on the previous Windows Installer sample.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.