我已经从Microsoft下载了SQL Server 2008 R2软件,并且正在编写无提示安装脚本。 我得到以下错误(和重复的粘贴工作不是一个意外,这是它是如何显示为我)
The following error occurred: Exception has been thrown by the target of an invocation. Error result: 1152035024 Result facility code: 1194 Result error code: 43216 Please review the summary.txt log for further details The following error occurred: Exception has been thrown by the target of an invocation. Error result: 1152035024 Result facility code: 1194 Result error code: 43216 Please review the summary.txt log for further details Microsoft (R) SQL Server 2008 R2 Setup 10.50.1600.01
这是详细的SQL安装日志中显示的内容。
2011-02-23 09:53:13 Slp: Running Action: ExecuteInitWorkflow 2011-02-23 09:53:13 Slp: Workflow to execute: 'INITIALIZATION' 2011-02-23 09:53:13 Slp: Error: Action "Microsoft.SqlServer.Configuration.BootstrapExtension.ExecuteWorkflowAction" threw an exception during execution. 2011-02-23 09:53:13 Slp: Microsoft.SqlServer.Setup.Chainer.Workflow.ActionExecutionException: Exception has been thrown by the target of an invocation. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentNullException: Value cannot be null. 2011-02-23 09:53:13 Slp: Parameter name: InstallMediaPath
希望有人能帮助我通过这个工作。 这是我的PowerShell代码的简单版本。
$arguments = @() $arguments += "/q" $arguments += "/ACTION=Install" $arguments += "/FEATURES=SQL,Tools" $arguments += "/INSTANCENAME=MSSQLSERVER" $arguments += "/SQLSVCACCOUNT=`"$NetBIOSDomainName\$SQLServerServiceAccount`"" $arguments += "/SQLSVCPASSWORD=`"$SQLServerServiceAccountPassword`"" $arguments += "/SQLSYSADMINACCOUNTS=`"$NetBIOSDomainName\$SQLSysAdminAccount`"" $arguments += "/AGTSVCACCOUNT=`"$NetBIOSDomainName\$SQLServerAgentAccount`"" $arguments += "/IACCEPTSQLSERVERLICENSETERMS" Start-Process "$SQLServerSetupLocation\setup.exe" -Wait -ArgumentList $arguments -RedirectStandardOutput error.txt
我想我的问题最终是因为我没有使用Start-Process cmdlet的-WorkingDirectory参数。 setup.exe文件调用所有types的进程作为安装的一部分,我认为它调用的subprocess没有意识到正确的“WorkingDirectory”。 工作的代码如下。
Start-Process "$SQLServerSetupLocation\setup.exe" -Wait -WorkingDirectory $SQLServerSetupLocation -ArgumentList $arguments