我已经开发了一个 .net 项目,现在正在执行安装程序。我的项目需要 Microsoft SQL 2008 或 Microsoft SQL 2008 Express。我创建了一个安装 Microsoft SQL 2008 Express 的 Bootstrap ,它工作正常,除非有人已经安装了 Microsoft SQL 2008。如果已安装 Microsoft SQL 2008,我如何绕过安装?
编辑: 此解决方案适用于 Microsoft SQL 2008:
<Product xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper" ProductCode="AAA">
<InstallChecks>
<RegistryCheck Property="IsInstalled" Key="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\SQL" Value="SQL2008" />
</InstallChecks>
<Commands Reboot="Defer">
<Command PackageFile="setup.exe" EstimatedInstallSeconds="15" >
<InstallConditions>
<BypassIf Property="IsInstalled" Compare="ValueExists" />
</InstallConditions>
</Command>
</Commands>
...
</Product>
最佳答案
老实说,我不是您尝试做的事情的专家。但是 SQL Server 发现报告对您有用吗? : SQL server discovery report
或
determine-installed-sql-server-instances
编辑:
我在想这样的事情:
<Product xmlns="http://schemas.microsoft.com/developer/2004/01/bootstrapper" ProductCode="AAA">
<InstallChecks>
<RegistryCheck Property="IsInstalled" Key="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names" Value="SQL" />
</InstallChecks>
<Commands Reboot="Defer">
<Command PackageFile="setup.exe" EstimatedInstallSeconds="15" >
<InstallConditions>
<BypassIf Property="IsInstalled" Compare="ValueExists" />
</InstallConditions>
</Command>
</Commands>
...
</Product>
关于.net - 如果存在 Microsoft SQL Server 实例,则绕过 SQLExpress 的安装,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14155921/