Consolidating MS SQL Server SP2 into installation files--script fixes

Source: Internet
Author: User
Tags mssql mssql server readline stdin

Just start a new notebook, a busy, loaded system. Small black Drive really many, 7788 also have twenty or thirty files to download, install. Turn to install development software is collapsing, a heap of SP waiting for us to fight! Microsoft left us the nightmare ah, so, began to download integrated SP patch software, but did not find the integrated version of the SQL Server2005 download, can only do, do an integrated version. A burst of Google on the web, see the garden. This article: Integrate MS SQL Server SP2 into the installation files, write very good, methods have, a look at a script integration, very good, unfortunately one of the implementation down, a bunch of errors, their own manual slightly adjusted under, has been tested through, Let's share it, and consolidate the development and enterprise version of the 32-bit installation package (with SP2) size 855mb,isz compression format. The revised script is as follows:

1/////////////////////////////////////////////////
2//slipsteaming MSSQL Server SP2
3//Author:zealic
4//Date:2007-03-19
5//version:1.01
6//
7//Author:hollis Yao
8//Date:2008-01-15
9//version:2.00
10/////////////////////////////////////////////////
One var swap = "D:\\swap";
var sqldir = "D:\\mssql";
var SP2 = "D:\\SP2";
var server = Sqldir + "\\Servers\\Setup";
var tools = Sqldir + "\\Tools\\Setup";
var log = "D:\\install.log";
17
Install ();
19
function Install ()
21 {
WScript.Echo ("Slipsteaming MSSQL Server SP2 by zealic, playse wait Processing");
Try
24 {
Installservers ();
//exec ("rd/q/S" + swap);
Installtools ();
Sucess ();
29}
catch (E)
31 {
WScript.Echo (E.name + ":" + e.message);
Fail ();
34}
35}
36
Panax Notoginseng function Installservers ()
38 {
TestRun ("xcopy/y/h" + SP2 + "\\*.msi" + server);
TestRun ("msiexec/quiet/a" + server + "\\sqlrun_as.msi targetdir=" + swap + "/L*VX" + log);
TestRun ("msiexec/quiet/a" + server + "\\sqlrun_dts.msi targetdir=" + swap + "/L*VX" + log);
TestRun ("msiexec/quiet/a" + server + "\\sqlrun_ns.msi targetdir=" + swap + "/L*VX" + log);
TestRun ("msiexec/quiet/a" + server + "\\sqlrun_rs.msi targetdir=" + swap + "/L*VX" + log);
TestRun ("msiexec/quiet/a" + server + "\\sqlrun_sql.msi targetdir=" + swap + "/L*VX" + log);
TestRun ("msiexec/quiet/a" + Swap + "\\sqlrun_as.msi/p" + SP2 + "\\sqlrun_as.msp" + "/L*VX" + log);
TestRun ("msiexec/quiet/a" + Swap + "\\sqlrun_dts.msi/p" + SP2 + "\\sqlrun_dts.msp" + "/L*VX" + log);
TestRun ("msiexec/quiet/a" + Swap + "\\sqlrun_ns.msi/p" + SP2 + "\\sqlrun_ns.msp" + "/L*VX" + log);
TestRun ("msiexec/quiet/a" + Swap + "\\sqlrun_rs.msi/p" + SP2 + "\\sqlrun_rs.msp" + "/L*VX" + log);
TestRun ("msiexec/quiet/a" + Swap + "\\sqlrun_sql.msi/p" + SP2 + "\\sqlrun_sql.msp" + "/L*VX" + log);
TestRun ("xcopy/y/e" + swap + "" + server);
51}
52
function Installtools ()
54 {
TestRun ("xcopy/y/h" + SP2 + "\\*.msi" + tools);
TestRun ("msiexec/quiet/a" + Tools + "\\sqlrun_tools.msi targetdir=" + swap + "2/L*VX" + log);
TestRun ("msiexec/quiet/a" + Swap + "2\\sqlrun_tools.msi/p" + SP2 + "\\sqlrun_tools.msp" + "/L*VX" + log);
TestRun ("xcopy/y/e" + swap + "2" + tools);
59}
60
function TestRun (RUNSTR)
62 {
The var wsh = new ActiveXObject ("Wscript.Shell");
The var sys32 = wsh. ExpandEnvironmentStrings ("%WINDIR%\\System32");
65
WSH. CurrentDirectory = SYS32;
The var ret = WSH. Run (runstr,0,true);
if (ret!= 0) fail ();
return to RET;
70}
71
The function of the RUNSTR exec ()
73 {
The WSH var = new ActiveXObject ("Wscript.Shell");
The var shell = wsh. ExpandEnvironmentStrings ("%comspec%");
The var ret = WSH. Run (Shell + "/k" + runstr,0,true);
(ret!= 0) fail ();
WSH. Run (Shell + "/k exit", 0,true);
return to RET;
80}
81
Fail function ()
83 {
WScript.Echo ("Process fail! Please retry execute the script, press ' Enter ' to exit.
//wscript.stdin.readline ();
Wscript.Quit ();
87}
88
function sucess ()
90 {
WScript.Echo ("Process ok! Press ' Enter ' to exit. ");
//wscript.stdin.readline ();
Wscript.Quit ();
94}
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.