如何检查wix 3.5中是否安装了SQL Server

时间:2012-07-25 20:50:38

标签: wix wix3.5

我在这里做错了什么。我从StackOverFlow thread获得了这些代码,但没有一个有效。

   <Property Id="SQLSERVER_INSTANCE">
      <RegistrySearch Id="SQLServerRegSearch" Root="HKLM" Key="SOFTWARE\Microsoft\Microsoft SQL Server" Type="raw" Name="InstalledInstances"/>
    </Property>
    <Feature Id="DatabaseFeature" Title="Database" Level="1" Display="expand">
      <Condition Level="0">
        <![CDATA[SQLSERVER_INSTANCE = ""]]>
      </Condition>
      <ComponentRef Id='SqlComponent' />
      <ComponentRef Id='cmpMDF' />
      <ComponentRef Id='cmpLDF' />
    </Feature>

2 个答案:

答案 0 :(得分:0)

32位和64位版本的Windows之间的SQL Server注册表项存在差异。

这很可能是您的WiX代码无法正常工作的原因。

请参阅此博客,了解一些全面的代码段:http://robs-got-a-blog.blogspot.com/2011/08/detecting-sql-server-from-wix-installer.html

答案 1 :(得分:-1)

这有效:

<Property Id="ISSQLSERVERSERVICEINSTALLED" >
  <RegistrySearch Id="IsSqlServerServiceInstalled" Root="HKLM" Key="SYSTEM\CurrentControlSet\services\MSSQLSERVER" Name="Description" Type="raw"/>
</Property>
相关问题