views:

167

answers:

1

Hi there,

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

+1  A: 

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.

Nick Kavadias
thanks for the suggestion, I will try it asap
dkson
OK, it's not very nice, and I still don't know why my approach didn't work, nor I know about the 'Medialayout'-Paramter, but it works like a charm
dkson