user2676202
user2676202

Reputation: 3

Wix: Determine if SqlLocalDB is installed

I'm trying to determine is it LocalDb installed and i tried to go the way from this link Determine if SqlLocalDB is installed

But i've got an error on my log file that: Registry key not found. Key = 'SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL12E.LOCALDB\MSSQLServer\CurrentVersion'

My code is:

<util:RegistrySearch Id="SearchForLocalDB" 
               Root="HKLM"
               Key="SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL12E.LOCALDB\MSSQLServer\CurrentVersion"
               Value="CurrentVersion"
               Variable="LocalDBVersion" 
               Result="value"/>
<PackageGroup Id="LOCALDB">
  <MsiPackage  Id="LOCALDB"
              DisplayName="Microsoft SQL Server 2014"
              Permanent="yes"
              Visible="yes"
              DisplayInternalUI="yes"
              SourceFile=".\SqlLocalDB.msi"
              InstallCondition="(LocalDBVersion &lt;= &quot;12.0&quot;)"
    />
</PackageGroup>

Upvotes: 0

Views: 2005

Answers (1)

caveman_dick
caveman_dick

Reputation: 6637

Use Result='exists' rather than pulling the actual value. You already have the version in the key value so you don't need to check for it in the InstallCondition.

Upvotes: 1

Related Questions