Asp. net--to create a full-featured installation program

Source: Internet
Author: User
Tags config implement interface modify sql net visual studio

The installation and deployment of many web-based applications, such as ASP and ASP.net, has been a hassle, typically by hand-copying, manually modifying related profiles (primarily database configurations), which is a little more obvious than the RPM on Windows Installer or Linux There's no technical content.


For FAT client applications, there has been a relatively sophisticated installer tool since early on, such as InstallShield, Installanywhere, Wise Installer, SWIFT Installer, and so on, some of which have been implemented across platforms, Can run on platforms such as Windows, Linxu, Java, and so on.


Starting with Visual Studio 6.0, Microsoft provides separate setup Tools that can be used to make simple installers, and later, the tool is integrated into Vs.net 2002/2003, and features are enhanced to make custom dialog boxes, etc. 。 The advantage is that it can be well integrated with vs.net projects, so that the entire solution (Solution) can generate the installation package at build time so that it is easy to implement daily builds (day build) while its drawbacks remain and do not allow more control over the installation process. The dialog box provides a limited number of features and types, and it is rare to see people using these dialogs to implement some of the more complex configurations of the system, such as database creation and initial data generation, which are involved in most applications.


There are a lot of good installation tools, during the installation of the implementation of the system can be configured, but after the installation, if the configuration changes, such as database migration, and become a headache, if the system to know more about the location of the configuration data, you can manually modify, What if I don't know? Do you want to uninstall it first and then reinstall it to complete the new configuration?


In a lot of good fat customer applications, the configuration interface is independent of the installation interface, so that after installing the system, flexibility to adjust its configuration, then take it to the ASP.net installation program.


1 to establish a solution Solution.


2 Establish WEB applications.


3 Add a new WinForms application AppConfig, add a WinForm, complete initialization system environment, modify system configuration functions (such as generating database, generating initial data, modifying database connection parameters in Web.config, machine.config or custom configuration file), and so on, to generate AppConfig.exe.


4 A New Installation project setup, in addition to the WEB application of the "Primary output" and "content output" into the project, but also the AppConfig "Primary output" to the project.


5 in the setup section of the "Custom Action" in the Setup project, add a custom action to run the "Primary output" AppConfig.exe from the AppConfig.


This asp.net installer will run the AppConfig WinForm program at the end of the run to complete the relevant configuration, such as the database. If the configuration changes later, you can run AppConfig.exe directly to change the configuration.


It is worth mentioning that since AppConfig is a WinForms application, there is a lot of room to play relative to the Installer dialog box, for example, I often add a reference to the SQL Server Admin Object Interop.SQLDMO.dll in the project so that I can lose In the list box in/Select SQL Server, the implementation automatically lists the list of available SQL Server names, looking professional.



Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.