Search code examples
wixlocaldbwix3.7

Determine if SqlLocalDB is installed


I am searching for a way to determine in WiX if SQLLocalDB is installed or not. How can I do this? - Can I check a registry-key? - When yes, which key?


Solution

  • A RegistrySearch should do it:

    <Property Id="LOCALDB">
       <RegistrySearch Id="SearchForLocalDB" Root="HKLM" 
                       Key="SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL11E.LOCALDB\MSSQLServer\CurrentVersion"
                       Name="CurrentVersion"
                       Type="raw" />
    </Property>
    

    That would get you the version.