Introduction Recently, a database installer is made. This plan is done with InstallShield X. The result is not bought, and the installation tool comes with Visual Studio.net can not meet the requirements, and finally develop it. Typically a setup interface includes a "window title", "banner picture", "banner header", "main text", "button", as shown in the figure:
The design summary is designed to design a form base class (WizardForm), create a different inheritance from the subclass of such installation steps, by a static HashTable type, through a static HashTable type, to save parameters between these installation steps value. Installing the database and initialization data Use the SQL script to generate, these scripts are uniformly saved in a formatted XML file, read the XML file by the path specified in the configuration file and is installed according to the registry The version, intercept the subsequent script package, save the last installed script version number in the registry of the target computer after the installation is successfully installed, for later upgrade installation. The installer saves the customized information displayed by the installation interface, such as "Window Title", "Banner Picture", the default "banner title", the default "main body text", etc., the specific configuration file content is as follows:
XML Version = "1.0" encodifg = "UTF-8"?>
appsettings>
configure>
Interface screenshot I define the database installer contains these steps:
Welcome (Welcome) Settings (Complete) Step Facts Forms The screenshots are as follows: 0000-00-00 PROMPLETED
1, welcome
2, authorization
3, set
4, confirm
5, progress
6, complete
Each step corresponds to a form class inherited from the base class WizardForm, and they set their own "Banner Titles" and "Main Text" properties through the configuration file (see the configuration file).
Installing the file installer Using the script package in the installation file to perform database operations, the installation file in this XML format contains scripts that create databases and each change in the release, and package these script packages. The specific installation file is as follows:
XML Version = "1.0" encoding = "UTF-8"?>
98A 217A 6-c 1A 2 -422A -81D8 -41C 9ec24abb1} "name =" gmis "version =" 1.0 "provike =" SQLSERVER "Remark =">>
/ * The following statement is very important! * / Use $ parameters [database] ]]]] script> packet>
Select * from master.dbo.sysobjects; Select * from master.dbo.sysmessages ]]]] script> packet>
Select * from master.dbo.sysobjects ]]]] script>
Select * from master.dbo.sysobjects ]]]] script> packet> database> After the installation information is installed, you need to save the current installation instance number (the ID attribute value of the installation file root node) and the ID attribute value of the installation file root node) and The database name and script package are installed in the later upgrade installation, and the pair is made according to the saved information to install from the breakpoint.