RegistryKey key=null;
key=Registry.LocalMachine.CreateSubKey("software\\Microsoft\\.NetFramework\\policy\\v1.1");
if(key==null || key.GetValue("4322")==null)
{
Process myPro=new Process();
myPro.StartInfo.FileName="dotnetfx.exe";
myPro.StartInfo.WindowStyle=ProcessWindowStyle.Hidden;
myPro.Start();
myPro.WaitForExit();
myPro.Close();
}