使用 LOCAL Server InstanceName 无人值守安装 SQL Server 2005 Express

发布于 2024-09-02 09:28:36 字数 805 浏览 2 评论 0原文

我正在使用 InnoSetup 创建安装包并安装 SQL Server 2005 Express。下面是我的 RUN 部分中出现的代码:

Filename: "{app}\SQL Server 2005 Express\SQLEXPR.exe" ; Parameters: "-q /norebootchk /qn reboot=ReallySuppress addlocal=all INSTANCENAME=(LOCAL) SCCCHECKLEVEL=IncompatibleComponents:1;MDAC25Version:0 ERRORREPORTING=2 SQLAUTOSTART=1 SAPWD=passwordhere SECURITYMODE=SQL"; WorkingDir: {app}\SQL Server 2005 Express; StatusMsg: Installing Microsoft SQL Server 2005 Express... Please Wait...;Check:SQLVerifyInstall

我想要完成的是安装 SQL Server 软件包,但仅让实例名称本身引用计算机名称,仅此而已。我收到的是命名实例,而不是本地实例,例如 MachineName\SQLEXPRESS,这不是我想要收到的。

我需要一个本地实例而不是命名实例,因为我的代码编写方式是为了能够安装有问题的数据库并与该数据库进行通信。相信我,如果这个安装包不是以前使用 MSDE 安装程序的包的替代品,我会更改它。我必须能够通过代码支持两者。欢迎任何建议,但我的主要目标是让安装程序仅使用计算机名称安静地安装的清晰简洁的方法。感谢您的帮助和支持!

I'm creating an install package using InnoSetup and installing SQL Server 2005 Express. Here's the code below that appears in my RUN section:

Filename: "{app}\SQL Server 2005 Express\SQLEXPR.exe" ; Parameters: "-q /norebootchk /qn reboot=ReallySuppress addlocal=all INSTANCENAME=(LOCAL) SCCCHECKLEVEL=IncompatibleComponents:1;MDAC25Version:0 ERRORREPORTING=2 SQLAUTOSTART=1 SAPWD=passwordhere SECURITYMODE=SQL"; WorkingDir: {app}\SQL Server 2005 Express; StatusMsg: Installing Microsoft SQL Server 2005 Express... Please Wait...;Check:SQLVerifyInstall

What I'm trying to accomplish is have the SQL Server package install but only have the instance name itself reference the name of the machine name and nothing more. What I'm receiving instead is a named instance instead of local such as MachineName\SQLEXPRESS which is not what I want to receive.

I need a local instance instead of a named instance due to the way my code is written to be able to install and talk with the databases in question. I would change it, trust me, were it not the fact that this install package is a replacement to a previous package that used the MSDE installer. I have to be able to support both through code. Any suggestions are welcome but a clear and concise method to get the installer to quietly install using only the machine name is my main goal. Thanks for the help and support!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

悟红尘 2024-09-09 09:28:36

以下是在代码中设置 InstanceName 的示例:

    ; Script generated by the Inno Setup Script Wizard.
    ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

    [setup]
    ; NOTE: The value of AppId uniquely identifies this application.
    ; Do not use the same AppId value in installers for other applications.
    ; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
    AppId={{4D044938-6185-4729-8EB9-33CFA5D51993}
    AppName=My Program
    AppVerName=My Program 1.5
    AppPublisher=My Company, Inc.
    AppPublisherURL=http://www.example.com/
    AppSupportURL=http://www.example.com/
    AppUpdatesURL=http://www.example.com/
    DefaultDirName={pf}\My Program
    DefaultGroupName=My Program
    OutputBaseFilename = setup
    Compression = lzma
    SolidCompression = yes

    [Languages]
    Name: "english"; MessagesFile: "compiler:Default.isl"

    [Tasks]
    Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked

    [Files]
    Source: "SQLEXPR.exe"; DestDir: "{app}"; Flags: ignoreversion
    ; NOTE: Don't use "Flags: ignoreversion" on any shared system files

    [Run]
    Filename: "{app}\SQLEXPR.exe" ; Parameters: "INSTANCENAME={code:MyInstanceName|'SQLEXPRESS'}";


    [Code]
    function MyInstanceName(Param: String): String;
    begin
      //This sets the value to \MSSQLSERVER.
      Result := ExpandConstant('{computername}') + '\MSSQLSERVER';
    end;

但是,从我在网上看到的情况来看,如果您希望实例名称成为计算机上的默认实例,实例名称应该是 MSSQLSERVER。

Here's a sample for setting the InstanceName in code:

    ; Script generated by the Inno Setup Script Wizard.
    ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

    [setup]
    ; NOTE: The value of AppId uniquely identifies this application.
    ; Do not use the same AppId value in installers for other applications.
    ; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
    AppId={{4D044938-6185-4729-8EB9-33CFA5D51993}
    AppName=My Program
    AppVerName=My Program 1.5
    AppPublisher=My Company, Inc.
    AppPublisherURL=http://www.example.com/
    AppSupportURL=http://www.example.com/
    AppUpdatesURL=http://www.example.com/
    DefaultDirName={pf}\My Program
    DefaultGroupName=My Program
    OutputBaseFilename = setup
    Compression = lzma
    SolidCompression = yes

    [Languages]
    Name: "english"; MessagesFile: "compiler:Default.isl"

    [Tasks]
    Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked

    [Files]
    Source: "SQLEXPR.exe"; DestDir: "{app}"; Flags: ignoreversion
    ; NOTE: Don't use "Flags: ignoreversion" on any shared system files

    [Run]
    Filename: "{app}\SQLEXPR.exe" ; Parameters: "INSTANCENAME={code:MyInstanceName|'SQLEXPRESS'}";


    [Code]
    function MyInstanceName(Param: String): String;
    begin
      //This sets the value to \MSSQLSERVER.
      Result := ExpandConstant('{computername}') + '\MSSQLSERVER';
    end;

However, from what I've seen on the net the instance name should be MSSQLSERVER if you want it to be the default instance on the machine.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文