如何在WiX安装程序中检测SQL Server Express [英] How to detect SQL Server Express in WiX installer

查看:126
本文介绍了如何在WiX安装程序中检测SQL Server Express的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何检测WiX安装程序中的计算机上是否已安装并正在运行Sql Server Express?

How do I detect if Sql Server Express is installed and running on a machine in a WiX installer?

我想在安装我的应用程序之前检查它是否尚未安装并运行,以通知用户在安装我的应用程序之前必须先安装它.

I want to check before installing my application and if it's not installed and running, to inform the user that it has to be installed first before installing my application.

推荐答案

我尝试了Krzysztof的解决方案(如上)-但是在某些使用此方法的计算机上,它无法正确检测出它们何时已安装Sql Express.

I tried Krzysztof's solution (above) - but on some machines when using this approach it wasn't correctly detecting when they did not have Sql Express installed.

这似乎是由于REG_MULTI_SZ InstalledInstances注册表值处理不当引起的吗?

It looked to be caused by mishandling of the REG_MULTI_SZ InstalledInstances registry value?

当我检查是否需要在安装程序中停止/重新启动Sql Server Express服务时,我决定只对它进行检查-因此,这是我的替代选择,我只在其中检查该服务:

As I was checking to see if I needed to stop/restart the Sql Server Express service in the installer, I decided to just check against that instead - so here's my alternative, where I just check for the service instead:

<Property Id="SQLEXPRESSINSTALLED" >
  <RegistrySearch Id="IsSqlExpressServiceInstalled" Root="HKLM" Key="SYSTEM\CurrentControlSet\services\MSSQL$SQLEXPRESS" Name="Description" Type="raw" Win64="no"/>
</Property>      

<Condition Message="Express Not Installed">SQLEXPRESSINSTALLED</Condition>

<Condition Message="Express Installed">NOT SQLEXPRESSINSTALLED</Condition>

有点骇人听闻,但似乎对我们的客户来说足够好(使用组件中的条件,而不是上面显示的示例启动条件)

Bit of a hack, but seems to work well enough for our customers (were using the conditions within components, rather then the example Launch conditions shown above)

这篇关于如何在WiX安装程序中检测SQL Server Express的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆