Program | data | Database Introduction
Recently done a database installer, this is intended to do with InstallShield X, the results of the D version did not buy, with the Visual Studio.NET with the installation tools can not meet the requirements, and finally have to develop their own.
Design outline
Design a form base class (Wizardform) and, depending on the required installation steps, create different subclasses that inherit from the class, and use a static Hashtable type global variable to hold the parameter values between these installation step forms. Both the installation database and the initialization data are generated using SQL script, which is uniformly stored in a formatted XML file, which is read by the installer through the path specified in the configuration file and intercepts the subsequent script package based on the installed version saved in the registry. After the installation is successful, save the last installed script package version number in the target computer's registry for later upgrades.
Setup uses the configuration file to save the customized information displayed by the installation interface, such as window title, banner picture, default banner title, default body text, and so on, with the details of the configuration file as follows:
<add key= "Warningtext" value= "Warning: This computer program is protected by copyright law and international treaties. Unauthorized reproduction or distribution of this program (or any part thereof) will be subject to severe civil and criminal penalties and will be prosecuted to the maximum extent permitted by law. "/>
<add key= "Welcome.bannertext" value= "Welcome to the IMRP Database Setup Wizard"/>
<add key= "Welcome.bodytext" value= Setup will guide you through the steps required to install the IMRP database on your computer. "/>
<add key= "Licence.bodytext" value= now please read this License agreement. If you accept the following terms, click Agree, and then click Next. Otherwise, click Cancel to exit the installation. "/>
Screenshot of the interface
I define the database installer to include these steps:
Welcome (Welcome)
Authorization (Licence)
Settings (Setting)
Confirmation (Confirm)
Progress (processing)
Complete (Completed)
Step form screenshots are as follows:
1. Welcome
2. Authorization
3, set up
4. Confirm
5. Progress
6. Complete
Each step corresponds to a form class that inherits from the base class Wizardform, and they set their own banner title and principal text attributes (see configuration file for details) through the relevant settings in the configuration file.
installation files
Setup uses the script package in the installation file to perform database operations, which contains scripts to create the database and each change that needs to be published, and to package the scripts for versioning. The contents of the specific installation files are as follows:
<packet name= "Standard" version= "1.0" title= "Standard Edition" remark= "This version has been updated since November 2002. ">
<script title= "CREATE DATABASE" remark= "Create a database of the specified name on the target computer's database server" >
<! [cdata[
IF $Parameters [Dbexist] = 0
BEGIN
CREATE database $Parameters [Database]
End
]]>
</script>
<script title= "Open the Database" remark= open the current database to ensure that subsequent operations are performed within the current database. ">
Installation Information
After the installation is complete, you need to be in the registry of the target computer (in the location of hkey_local_machine\software\<companyname>\<productname><edition> Saves the current installation instance number (the id attribute value of the installation file root) and the database name as well as the script package version, which, when installed at a later time, is based on the saved information to start the installation from the breakpoint.
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.