如何打包SQL Service

Corny 2001-11-17 05:47:54
由于一些众所周知的原因,我们不想用户自己安装SQL Server,所以只需要在服务器端安装一个SQL Service就可以(不要其他的如Enterprise Manager等一切东西),如果这样,如何打包Service,包括哪些文件和组件呢。请高手们解答吧
...全文
81 1 打赏 收藏 转发到动态 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
fly_horse_huang 2001-11-30
  • 打赏
  • 举报
回复
只需安装SQL Server Desktop Engine就可以了。
{//摘自SQL Server 联机丛书: "桌面上的 SQL Server 2000数据库"
SQL Server 关系数据库引擎的可再分发版本,第三方软件开发商可以将其包括在使用 SQL Server 存储数据的应用程序中。SQL Server 2000 Desktop Engine 可作为一组 Windows 安装程序合并模块使用,并且可以包含在应用程序安装中。

SQL Server 2000 Desktop Engine 不包括图形管理工具;分发引擎的应用程序通常被编码为执行任何需要的数据库管任务。可以通过 SQL Server 2000 图形工具管理随其它 SQL Server 版本一起安装的 Desktop Engine 实例
}

{//摘自SQL Server 联机丛书:"SQL Server 2000 Desktop Engine Setup"
The Microsoft® SQL Server™ 2000 Desktop Engine includes a Setup.exe file that an application setup process can use to install the SQL Server 2000 Desktop Engine. You can define settings for customizing the way Setup.exe installs SQL Server 2000 Desktop Engine. These settings can be specified through either command prompt switches or an .ini file.

Syntax
setup [/?]

[

[ /i package_file

[ /settings ini_file ]

| [ [ TARGETDIR="executable_folder_path"]

[ DATADIR="data_folder_path" ]

[ INSTANCENAME="instance_name" ]

[ COLLATION="collation_name" ]

[ CALLBACK=Dllname!CallbackFunctionName ]

[ USEDEFAULTSAPWD | SAPASSWORD="sa_password" ]

]

]

| [ /x package_file ]

]

[ /L*v [filename] ]

[ /qn | /qb ]

Arguments
/?

Displays a syntax summary of the setup switches. setup displays more switches than it accepts; use only the switches documented in this topic.

/i package_file

Specifies the name of the Windows Installer installation package file (an .msi file) to be used to install an instance of the SQL Server 2000 Desktop Engine. Place the .msi file in the same folder as setup.exe. If /i is not specified, copy all 16 of the .msi files from the \Sqlmsde\Setup folder on the SQL Server 2000 compact disc to the same folder as Setup.exe.

settings ini_file_name

Specifies the name of an .ini file containing settings for TARGETDIR, DATADIR, INSTANCENAME, COLLATION, USEDEFAULTSAPWD, and SAPASSWORD. If /settings is specified, these options should be set in the .ini file, not in the command prompt switches. Place the .ini file in the same folder as setup.exe.

TARGETDIR="executable_folder_path"

Specifies the folder where the Desktop Engine executable files are installed. The default for executable_folder_path is C:\Program Files\Microsoft SQL Server.

DATADIR="data_folder_path"

Specifies the folder where the SQL Server system databases are built. The default is the same folder used for the Desktop Engine executable files.

INSTANCENAME="instance_name"

Specifies the name for the instance. If no instance name is specified, the instance is installed as a default instance.

COLLATION="collation_name"

Specifies the SQL Server collation that will be used as the default collation for this instance of the Desktop Engine. For information about a list of collation names, see Windows Collation Name and SQL Collation Name.

CALLBACK=Dllname!CallbackFunctionName

Specifies the name of the DLL containing the Desktop Engine Windows Installer callback function, and the name of the callback function. For more information, see Desktop Engine Windows Installer Callback Functions.

USEDEFAULTSAPWD

Specifies that setup assign the default password (NULL) to the sa login.

SAPASSWORD="sa_password"

Specifies that setup assign a password to the sa login. When /i is specified, you must specify either /USEDEFAULTSAPWD or /SAPASSWORD, but not both.

/x package_name

Specifies the name of the Windows Installer installation package file (an .msi file) to use when uninstalling an instance of SQL Server 2000 Desktop Engine. You must specify the name of the same installation package file that was used to install the instance of the Desktop Engine. Place the .msi file in the same folder as setup.exe.

/L*v [filename]

Specifies that a verbose log be created. If filename is specified, the log is stored in the file specified.

/qn

Specifies that setup run with no user interface.

/qb

Specifies that setup show only the basic user interface. Only dialog boxes displaying progress information are displayed. Other dialog boxes, such as the dialog box that asks users if they want to restart at the end of the setup process, are not displayed.

Remarks
SQL Server 2000 Desktop Engine Setup is a tool that applications can use to install the SQL Server 2000 Desktop Engine as a part of the typical installation process. It is not intended as a tool for installing the database engine from the SQL Server 2000 compact disc. To install SQL Server 2000 from a compact disc, use the autorun.exe component in the root folder of the SQL Server 2000 compact disc. For more information about installing SQL Server from the compact disc, see Overview of Installing SQL Server 2000.

Applications that do not use Windows Installer as their setup mechanism can use SQL Server 2000 Desktop Engine Setup. Applications that use Windows Installer should instead use the SQL Server 2000 Desktop Engine Merge Modules. For more information about using the merge modules, see SQL Server 2000 Desktop Engine and Windows Installer.

To run SQL Server 2000 Desktop Engine Setup, the application setup process must copy these files to the same folder:

Setup.exe from the \Sqlmsde folder on the SQL Server 2000 compact disc.


Sqlrun.cab from the \Sqlmsde\Setup folder on the SQL Server 2000 compact disc.


Either all of the SqlrunXX.msi installation package files from the \Sqlmsde\Setup folder on the SQL Server 2000 compact disc, or a custom installation package file. For more information, see Managing Desktop Engine Installation Package Files.


Optionally, an .ini file with settings for the TARGETDIR, DATADIR, INSTANCE NAME, COLLATION, USEDEFAULTSAPWD, and SAPASSWORD options.
The application then executes setup.exe at the point in the installation process where the Desktop Engine should be installed. The setup process of an application typically will use one of two mechanisms to execute the Desktop Engine Setup:

Execute Setup.exe from a batch command file or from the command prompt. When using this method, setup switches are specified in the same way they would be specified for any other command prompt utility.


Execute Setup.exe from within the application setup executable file using a method similar to the Win32® CreateProcess() function. In this case, setup switches are specified in a character string passed in using the lpCommandLine paramter. For information about using CreateProcess() to execute Setup.exe, see Desktop Engine Installation Sample.
If neither /qn nor /qb is specified, Setup.exe displays all user interface dialog boxes.

Whenever an application needs to uninstall an instance of the Desktop Engine, it must call the SQL Server 2000 Desktop Engine Setup using the /x switch to specify the same .msi file that was used to install that instance. For example, to uninstall a named instance installed with a custom installation package file named MyCustom.msi, execute:

Setup /x MyCustom.msi

Settings Using an .ini File
Optionally, the TARGETDIR, DATADIR, INSTANCE NAME, COLLATION, USEDEFAULTSAPWD, and SAPASSWORD options can be specified using an .ini file. The first line in the .ini file must contain the string [Options]. The format of the .ini file is shown in this example:

[Options]
TARGETDIR="C:\Program Files\Microsoft SQL Server\Mssql$MyInstance\Binn"
DATADIR="C:\Program Files\Microsoft SQL Server\Mssql$MyInstance\Data"
INSTANCENAME=MyInstance



Note Settings that contain spaces should be enclosed with quotation marks.


Recommended Settings for TARGETDIR and DATADIR
Because your application is installing an instance of SQL Server 2000, it should typically specify the same default folders that SQL Server 2000 uses for instance installations. You can specify different locations if you want to install the instance in a non-default location.

When installing a default instance, the recommended default settings are:

TARGETDIR="C:\Program Files\Microsoft SQL Server\Mssql\Binn"
DATADIR="C:\Program Files\Microsoft SQL Server\Mssql\Data"

When installing a named instance, the recommended default settings are:

TARGETDIR="C:\Program Files\Microsoft SQL Server\Mssql$MyInstance\Binn"
DATADIR="C:\Program Files\Microsoft SQL Server\Mssql$MyInstance\Data"
INSTANCENAME="MyInstance"
}

我现在也被这个难题搞得焦头烂额,zh以后可以多讨论一下:homeat@mai,
homeat@mail.china.com





34,587

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧