In my wix installer I have these properties to get sql data path
<Property Id="SQLSERVERINSTANCENAME" >
<RegistrySearch Id="SqlServerInstanceName" Root="HKLM" Key="SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\SQL" Name="MSSQLSERVER" Type="raw"/>
</Property>
<Property Id="SQLSERVERDATAPATH" >
<RegistrySearch Id="SqlServerDataPath" Root="HKLM" Key="SOFTWARE\Microsoft\Microsoft SQL Server\[SQLSERVERINSTANCENAME]\Setup" Name="SQLDataRoot" Type="raw"/>
</Property>
but it doesn’t work on 64bit Windows 2008 Server R2
Try adding
Win64="yes", this will tell theRegistrySearchto look in the 64-bit of the registry. Should have added this will tell the Search to only look in the 64-bit part if you need it to search both then useWin64="$(var.Platform)"and specify the platforms like so: