One-click installation of. NET Framework, MSDE, Web installer, Windows Installer, restore database file, registry ..
What is "one-click installation "? My explanation is that when you run the installer.. NET Framework, SQL Server (MSDE), web applications, other installation files, registry modifications, database restoration, and other operations are installed at one time. You do not need to perform any other operations, in addition, you do not need to perform any operations during the installation process. The system automatically replaces user operations, such as installation.. NET Framework.
The principle is to use batch processing. The specific code is as follows.
1 @ echo start installation. Please wait ......
2 "tools \ windowsinstaller"/quiet/norestart
3 goto setupmsde
4
5: setupmsde
6 CD MSDE
7 setup
8 CD ..
9 "tools/SC" Config MSSQLServer start = auto
10 "tools/SC" Start MSSQLServer
11 goto setupframework
12
13: setupframework
14 CD framework
15 install/Q
16 CD ..
17 goto regimport
18
19: regimport
20 CD tools
21 Reg import iesettings. Reg
22 CD ..
23 goto setupprograme
24
25: setupprograme
26 CD Web
27 Setup/Passive
28 CD ..
29 CD WebService
30 Setup/Passive
31 CD ..
32 CD Client
33 Setup/Passive
34 CD ..
35 goto next
36
37: Next
38 copy "tools \ dB. Bak" C: \ Program Files"
39 copy "tools \ restore. SQL" C: \ Program Files"
40 if not exist "C: \ gyyjb_data \ MSSQL" Goto createdatafolder
41 goto delbackdatafile
42
43: createdatafolder
44 C:
45 if not exist "C: \ gyyjb_data" Goto creategyyjb_data
46 goto createmssql
47
48: creategyyjb_data
49 MD "C: \ gyyjb_data"
50 goto createmssql
51
52: createmssql
53 MD "C: \ gyyjb_data \ MSSQL"
54 goto delbackdatafile
55
56: delbackdatafile
57 del/Q "C: \ gyyjb_data \ MSSQL"
58 goto backdatabase
59
60: backdatabase
61 osql.exe/USA/pgyyjb/dmaster/I "C: \ Program Files/restore. SQL"
62 del "C: \ Program Files \ dB. Bak"
63 del "C: \ Program Files \ restore. SQL"
64 goto regiisclient
65
66: regiisclient
67 C:
68 CD \
69 cd c: \ winnt \ Microsoft. NET \ framework \ v1.1.4322
70 aspnet_regiis-C
71 CD \
72 cd c: \ WINDOWS \ Microsoft. NET \ framework \ v1.1.4322
73 aspnet_regiis-C
74 goto exitsetup
75
76: exitsetup
77 @ ECHO: the installation is successful. Thank you for using the remote education management system.
78
Explanation:
1. "tools \ windowsinstaller"
"Tools" is a tool folder file created by me. It is installed on a Windows 2000 system that cannot be automatically updated.
2. "tools \ windowsinstaller"/quiet/norestart.
In the Tools Folder, you can find the executable file windowsinstaller3.1.exe. The/quiet parameter indicates static installation and/norestart indicates that the system will not restart after installation.
3. cd msde setup CD ..
Go to the MSDE installation folder and install the database file.
4. "tools/SC" Config MSSQLServer start = auto
"Tools/SC" Start MSSQLServer
Go to "Tools" to find SC .exe. First, set the MSSQLServer configuration file to automatic start, and then start the MSSQLServer service immediately to restore the database file in the future.
5. CD framework install/q cd ..
Go to the. NET Framework folder to install. NET Framework. Install is the master installation file after decompression. The/Q Parameter indicates static installation and does not require customer participation.
6. CD tools Reg import iesettings. Reg CD ..
Go to "Tools" and find reg.exe. Import the iesettings. reg registry export file to the currently installed computer registry.
7. CD Web Setup/Passive CD ..
Install the Web Installer. The parameter/Passive indicates static installation without the customer's involvement.
8. If not exist "C: \ gyyjb_data \ MSSQL" Goto createdatafolder
This is the file to be recovered from the database. If it does not exist, it is created. If it exists, it is restored.
92.16osql.exe/USA/pgyyjb/dmaster/I "C: \ Program Files/restore. SQL"
Use the command line tool osql.exe to restore the database. Parameter/USA: username SA,/pgyyjb: Password gyyjb
Parameter "C: \ Program Files/restore. SQL": restores the SQL script of the database.
10. cd c: \ WINDOWS \ Microsoft. NET \ framework \ v1.1.4322 aspnet_regiis-C
Re-register the client script
The following is the script used to restore the database.
1use master
2if not exists (select * From sysdatabases where name = 'gyyjb ')
3 begin
4 Create Database gyyjb
5 end
6if exists (select * From sysdevices where name = 'dbdisk ')
7 begin
8 exec sp_dropdevice 'dbdisk'
9 end
10 else
11 begin
12 exec sp_addumpdevice 'disk', 'dbdisk', 'db. Bak'
13 End
14 Restore database gyyjb from disk = 'C: \ Program Files \ dB. Bak'
15 with move 'gyyjb _ data' to 'C: \ gyyjb_data \ MSSQL \ gyyjb_data.mdf ',
16 move 'gyyjb _ log' to 'C: \ gyyjb_data \ MSSQL \ gyyjb_log.ldf'
17
Other Instructions
1. For Windows Installer. EXE, if Windows 2000 is not connected to the Internet, the version of Windows installer should be below 3.0. Therefore, the installation parameters mentioned above are not supported. Therefore, the installation file is updated to 3.1.
2. SC .exe function, SQL serser service management. Windows 2000 does not install this program by default. You can find. XP on Windows 2000 random installation disk, Windows 2003 comes.
32.16reg.exe function, registry service management. Windows 2000 does not install this program by default. You can find. XP on Windows 2000 random installation disk, Windows 2003 comes.
4. aspnet_regiis-C when the system first installs. NET Framework and then IIS, there is a lack of verification scripts. just re-register it.
5. Go to the Internet and find a bat tool compiled into the EXE file, such as batfoexe, which will make a beautiful Installation Guide file.
6. Now you can see a command line window-based Installer. What if you want an installer with a Windows form? You can find an MSI production tool on the Internet, such as InstallShield.
7. MSDE is installed first, and the database file is restored. After the database is installed, it takes several seconds to start the Database Service (asynchronous process). Therefore, the database is restored to the end.
8. Deletion of database files. If a restored database file exists during installation, the database will be restored. Only database files will be created, and the restored database files will not be overwritten, therefore, you need to delete the original database file.