在 boostrapper 中安装 SQL Server 2014 Express 作为先决条件 [英] Installing SQL Server 2014 Express as a prerequisite in boostrapper

查看:26
本文介绍了在 boostrapper 中安装 SQL Server 2014 Express 作为先决条件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 boostrapper (Wix 3.11) 来设置安装,并以 SQL Server 2014 Express 作为先决条件.

I am trying to use boostrapper (Wix 3.11) to set up an installation, with SQL Server 2014 Express as a prerequisite.

当我使用命令行安装 setup.exeSQLEXPR_x64_ENU.exe 时,它运行良好.

It works well when I install setup.exe or SQLEXPR_x64_ENU.exe with command line.

命令行如下:

SQLEXPR_x64_ENU.exe /q /ACTION=Install /FEATURES=SQL 
       /INSTANCENAME=MSSQLSERVER /SQLSVCACCOUNT="NT AUTHORITY\Network Service"  
       /SQLSYSADMINACCOUNTS="NT AUTHORITY\Network Service" 
       /AGTSVCACCOUNT="NT AUTHORITY\Network Service" 
       /IACCEPTSQLSERVERLICENSETERMS /SECURITYMODE=SQL SAPWD="TestPassWord"

但是,当我尝试从 boostrapper 运行它时它失败了.它总是抛出相同的错误.

However, it fails when I try to run it from boostrapper. It always throws the same error.

错误:操作Microsoft.SqlServer.Configuration.SetupExtension.ValidateFeatureSettingsAction"在执行过程中引发异常.
Microsoft.SqlServer.Setup.Chainer.Workflow.ActionExecutionException:值不能为空.
参数名称:userName ---> System.ArgumentNullException:值不能为空.

Error: Action "Microsoft.SqlServer.Configuration.SetupExtension.ValidateFeatureSettingsAction" threw an exception during execution.
Microsoft.SqlServer.Setup.Chainer.Workflow.ActionExecutionException: Value cannot be null.
Parameter name: userName ---> System.ArgumentNullException: Value cannot be null.

以下是我用来设置安装程序的代码:

The following is the code I'm using to set up an installer:

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:bal="http://schemas.microsoft.com/wix/BalExtension"> 
      <?define Account = 'NT AUTHORITY\Network Service'?>
      <?define SAPassword = "TestPassWord"?>     
        <Bundle Name="Setup" Version="1.0.0.0" Manufacturer="Company" UpgradeCode="{GUID}">
            <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense">
        <bal:WixStandardBootstrapperApplication
            LicenseUrl=""
            ThemeFile="HyperlinkTheme.xml"
            LocalizationFile="HyperlinkTheme.wxl"
            SuppressOptionsUI="yes" />
        </BootstrapperApplicationRef>
            <Chain>
          <ExePackage Id ="SQL_express" SourceFile="$(var.PreReqPath)\SQLExpress\SQLEXPR_x64_ENU.exe" Compressed="yes" Vital="no" InstallCommand="/q /ACTION=Install /FEATURES=SQL /INSTANCENAME=MSSQLSERVER /SQLSVCACCOUNT=$(var.Account) /SQLSYSADMINACCOUNTS=$(var.Account) /AGTSVCACCOUNT=$(var.Account) /IACCEPTSQLSERVERLICENSETERMS /SECURITYMODE=SQL /SAPWD=$(var.SAPassword)" />
            </Chain>
        </Bundle>
</Wix>

我曾尝试将 Permachine="Yes" 添加到 ExePackage 行,但没有解决问题.

I have tried to add Permachine="Yes" to the ExePackage line but it doesn't solve the problem.

我也尝试过右键单击安装程序并以管理员身份运行它,但它仍然不起作用.

I have also tried to right-click on the installer and run it as administrator but it still doesn't work.

希望有人能帮我解决这个问题.

Hopefully someone can help me with this issue.

推荐答案

好久没看这个了,但现在似乎没有其他人在附近.我试一试:我猜你正在使用 预处理器变量 在你的源代码中,而不是运行时变量.换句话说,"$(var.VariableName)" 条目在 构建时 解析(当你的 WiX Bundle 被编译 - 这有时是好的code>) 而不是运行时(安装 WiX Bundle 时 - 这通常是需要的).

Haven't looked at this in a while, but nobody else seems to be around right now. I'll give it a go: I guess you are using pre-processor variables in your source there, and not runtime variables. In other words the "$(var.VariableName)" entries are resolved at build-time (when your WiX Bundle is compiled - which is sometimes OK) and not at run-time (when your WiX Bundle is installed - which is often desired).

换句话说,我假设您的预处理器变量解析为编译期间的空白字符串,这就是您安装的原因不行.没有为所有预处理器字段指定任何值.

In other words I would assume your pre-processor variables resolve to blank strings during compilation, and that is why your install does not work. There are no values specified at all for all pre-processor fields.

作为测试,可以将一些硬编码值编译为smoke测试",以确定是否是这种情况.然后尝试变量元素 描述如下.

As a test, maybe compile your bundle with some hard-coded values as a "smoke test", to determine if this is the case. Then try the Variable element described below.

模型:

<ExePackage Id ="SQL_express" SourceFile="SQLEXPR_x64_ENU.exe" Compressed="yes" Vital="no" InstallCommand="/q /ACTION=Install /FEATURES=SQL /INSTANCENAME=MSSQLSERVER /SQLSVCACCOUNT=TestAccount /SQLSYSADMINACCOUNTS=SqlAccount /AGTSVCACCOUNT=SvcAccount /IACCEPTSQLSERVERLICENSETERMS /SECURITYMODE=SQL /SAPWD=SAPassword" />

<小时>

也许您可以查看 Neil Sleightholm 的博客,了解如何处理此问题的一些想法(我没有要添加的完整工作示例):http://neilsleightholm.blogspot.com/2012/05/wix-燃烧提示.html


Maybe you can have a look at Neil Sleightholm's blog for some ideas how to approach this (I don't have a fully working sample to add): http://neilsleightholm.blogspot.com/2012/05/wix-burn-tipstricks.html

我认为关键是变量元素:

<Variable Name="InstallFolder" Type="string" Value="[ProgramFilesFolder]ACME\My App" />

看起来您可以通过设置 Overridable 属性yes (该链接的页面底部).我从来没有试过这个.看起来这些 Variable 元素使用标准的 MSI 括号约定解析:[InstallFolder].示例:

It looks like you can override such values at the command line by setting the Overridable attribute to yes (bottom of the page for that link). I have never tried this. It looks like these Variable elements resolve using the standard MSI-brace convention: [InstallFolder]. Sample:

<MsiProperty Name="INSTALLLOCATION" Value="[InstallFolder]" /> 

再次查看 Sleightholm 的模板 用于上述片段的完整上下文.您将使用 ExePackage 而不是 MsiPackage 显然.

看来您可以忽略 WixVariable元素 用于您的用例(而不是 变量元素,您将需要).

It appears you can ignore the WixVariable element for your use-case (as opposed to the Variable element which you will need).

这篇关于在 boostrapper 中安装 SQL Server 2014 Express 作为先决条件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆