title: Enable .Net Framework 3.5 SP1 from 'Programs and Features' and install it using NSIS
body: <p>I am creating installer using nsis for my windows form application. I need .Net Framework 3.5 SP1 as pre-requisites for my application. So using NSIS i check if it is available in client machine or not. If not then it will install it silently. But it gives me an error. I know .Net Framework 3.5 SP1 is required to enable from 'Program and Features' in control panel.</p>
  
  <p>So how can i enable feature '.NET FRAMEWORK 3.5' from control panel using NSIS script.</p>
  
  <p>My nsis section to check and install .Net Framework 3.5 SP1 is : </p>
  
  <pre><code> section
      SetOutPath "$temp\Pre_requisites"
      ; check and install .Net Framework 3.5SP1
      ReadRegStr $R1 HKLM "Software\Microsoft\NET Framework Setup\NDP\v3.5" "SP"
      ${If} $R1 != "1"
                     DetailPrint "Microsoft .NET Framework 3.5 SP1 needed. Installing..."              
                     File "$temp\Pre_requisites\dotnetfx35.exe"      
                     ExecWait '"$temp\Pre_requisites\dotnetfx35.exe" /q /norestart'
      ${Else}
      DetailPrint "Microsoft .NET Framework 3.5 SP1 Found."
      ${EndIf}
   sectionend
  </code></pre>
  
  <p>Error message is(I have tried this in windows 7 SP1 64bit):</p>
  
  <p><a href="https://i.stack.imgur.com/rK9vH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rK9vH.png" alt="enter image description here"></a></p>
  
  <p>Thanks..!</p>