title: Detect SQL Server 2008 R2
body: <p>I've googled a day but the question is still question: how to detect SQL Server 2008 R2 on various Windows versions:</p>
  
  <ul>
  <li>via <strong>registry</strong> (would be our favorite solution),</li>
  <li>via <strong>file system</strong>,</li>
  <li>via installer <strong>exit code</strong>?</li>
  </ul>
  
  <p>Installer developed with NSIS. Some additional informations:</p>
  
  <p><strong>Registry</strong></p>
  
  <p>Samples on the net are out of date or simply improper. Not just R2 but 2k8 detection is problematic too.</p>
  
  <p><strong>File system</strong></p>
  
  <p>I have no idea what files are especially from 2k8 R2.</p>
  
  <p><strong>Installer exit code</strong></p>
  
  <p>In some cases exits without error code (i.e. prerequisites missing).</p>