title: Detecting if SQL Server 2008 is installed
body: <p>I am using <a href="http://dotnetinstaller.codeplex.com/" rel="nofollow noreferrer">dotNetInstaller</a> as a bootstrapper and I need to detect if SQL Server 2008 or above is installed as a prerequisite. </p>
  
  <p>Currently I am using this registry to detect the installation:
  <code>HKLM\SOFTWARE\Microsoft\Microsoft SQL Server 2008 Redist\SharedManagementObjects\1033\CurrentVersion\Version</code></p>
  
  <p>If the value of <code>Version</code> is 10.0.0 or higher it detects it as installed.  We tried the installation package on 10 machines here (Windows XP SP3 &amp; Windows 7) and the prerequisite worked fine. We are getting reports from a lot of people that although they have SQL 2008 installed it does not detect the install.</p>
  
  <p>From the log:</p>
  
  <pre><code>2010-07-13 09:33:49 Checking whether registry value 'SOFTWARE\Microsoft\Microsoft SQL Server 2008 Redist\SharedManagementObjects\1033\CurrentVersion\Version' exists
  2010-07-13 09:33:49 Opening 64-bit registry view (KEY_WOW64_64KEY)
  2010-07-13 09:33:49 *** No registry key found: SOFTWARE\Microsoft\Microsoft SQL Server 2008 Redist\SharedManagementObjects\1033\CurrentVersion\Version, default value: false
  2010-07-13 09:33:49 -- Microsoft SQL Server 2008 R2 x86 (Microsoft SQL Server 2008 R2 x86 Express): NOT INSTALLED
  </code></pre>
  
  <p>dotNetInstaller Check:</p>
  
  <pre><code>&lt;installedcheck type="check_registry_value"
                                              rootkey="HKEY_LOCAL_MACHINE"
                                              path="SOFTWARE\Microsoft\Microsoft SQL Server 2008 Redist\SharedManagementObjects\1033\CurrentVersion"
                                              fieldname="Version"
                                              fieldtype="REG_SZ"
                                              fieldvalue="10.0.0"
                                              comparison="version_ge"
                                              wowoption="WOW64_64"
                                              defaultvalue="False"
                                              description="Installed Check" /&gt;
  </code></pre>
  
  <p>Does anyone know the definitive key to check?</p>