How to make installer to install DirectX?
I want to know how to make installer which not only checks whether DirectX is installed if yes then which version if not then install Direct X in my system.Earlier I did the same for .Net framework using WIX bootstrapper and that is working fine.But I am really confuse for Direct X.

gunjan aroraPosted Apr 14, 2014, 5:13 AM
Anurag SarkarPosted Apr 14, 2014, 4:09 AM
You can use the following code for getting the Direct X Version but its bit slow you need to wait after running the code.. It will take 5-10 sec for getting the directX version.
private void button1_Click(object sender, EventArgs e)
{
Process.Start("dxdiag", "/x dxv.xml");
while (!File.Exists("dxv.xml"))
Thread.Sleep(1000);
XmlDocument doc = new XmlDocument();
doc.Load("dxv.xml");
XmlNode dxd = doc.SelectSingleNode("//DxDiag");
XmlNode dxv = dxd.SelectSingleNode("//DirectXVersion");
textBox1.Text= dxv.InnerText.Split(' ')[1];
}