Management Studio 2008 快速安装问题
我在通过 C# 代码安装 Management Studio 2008 Express 时遇到一些问题。
代码如下所示:
using (Process MMSInstall = new Process())
{
var psi = new ProcessStartInfo(PathExe.FullName, "/qs /Features=SSMS /Action=Install");
MMSInstall.StartInfo = psi;
MMSInstall.Start();
MMSInstall.WaitForExit();
}
PathExe 是一个 FileInfo-Instance。
但安装总是失败:
Exception type: Microsoft.SqlServer.Setup.Chainer.Workflow.NoopWorkflowException
Message:
No features were installed during the setup execution. The requested features may already be installed. Please review the summary.txt log for further details.
通过命令提示符安装时
C:\>SQLMANAGEMENTSTUDIO_X86_DEU.EXE /qs /Features=SSMS /Action=Install
一切正常。
我查看了日志文件(Detail.txt),并发现了差异: 从命令提示符运行时,“设置:MEDIALAYOUT”设置为“高级”(pastebin.org/36222),从我的小 C#-App 安装时,它设置为“核心”(pastebin.org/36221)
我尝试将 /MEDIALAYOUT=Advanced 附加到我的代码中的 ProcessStartInfo-Arguments,但此选项被忽略。我不知道这个参数的作用,也找不到有关它的任何文档。
有什么想法如何解决这个问题或在哪里寻找?
我正在 Windows Vista Ultimate SP1 上进行测试
I have some trouble installing Management Studio 2008 Express through C#-Code.
The code looks like this:
using (Process MMSInstall = new Process())
{
var psi = new ProcessStartInfo(PathExe.FullName, "/qs /Features=SSMS /Action=Install");
MMSInstall.StartInfo = psi;
MMSInstall.Start();
MMSInstall.WaitForExit();
}
PathExe is a FileInfo-Instance.
But the installation always fails:
Exception type: Microsoft.SqlServer.Setup.Chainer.Workflow.NoopWorkflowException
Message:
No features were installed during the setup execution. The requested features may already be installed. Please review the summary.txt log for further details.
When installing via command prompt
C:\>SQLMANAGEMENTSTUDIO_X86_DEU.EXE /qs /Features=SSMS /Action=Install
everything works fine.
I looked through the logfiles (Detail.txt), and spottet a difference:
When running from the command prompt, 'Setting: MEDIALAYOUT' is set to 'Advanced' (pastebin.org/36222), when installing from my little C#-App it's set to 'Core' (pastebin.org/36221)
I tried to append /MEDIALAYOUT=Advanced to the ProcessStartInfo-Arguments in my code, but this options is ignored. I don't know what this parameter does, and I could not find any documentation about it.
Any ideas how to solve this or where to look for?
I am testing on Windows Vista Ultimate SP1
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
而不是直接调用可执行文件,而是调用
%windir%\system32\cmd.exe
Cmd 有一个 /C 开关,允许您传入要运行的命令。因此,您需要传入
'/c "SQLMANAGEMENTSTUDIO_X86_DEU.EXE /qs /Features=SSMS /Action=Install"'
作为参数。
instead of calling the executable directly call
%windir%\system32\cmd.exe
Cmd has a /C switch which allows you to pass in a command to run. So you'd pass in
'/c "SQLMANAGEMENTSTUDIO_X86_DEU.EXE /qs /Features=SSMS /Action=Install"'
as a parameter.