7

I am creating an installer for an Application that requires MSMQ to be installed, so if MSMQ is not installed, I need to install the msmq. So can MSMQ be installed using C# or any command??

I am using .net 4.0.

Thanks in advance

Sumit
  • 2,932
  • 6
  • 32
  • 54

1 Answers1

0

Can you try to launch a sub-process with:

using (Process process = new Process())
{
 process.StartInfo.FileName = Environment.GetFolderPath(Environment.SpecialFolder.System) + "\\" + "pkgmgr.exe";
 process.StartInfo.Arguments = "/iu:MSMQ-Container;MSMQ-Server";
 process.StartInfo.CreateNoWindow = true;
 process.StartInfo.ErrorDialog = true;
 process.StartInfo.UseShellExecute = false;
 process.Start();
 process.WaitForExit();
}
Mathias Florin
  • 48
  • 3
  • 19