.net - 如果存在 Microsoft SQL Server 实例,则绕过 SQLExpress 的安装

标签 .net windows installation windows-installer bootstrapper

我已经开发了一个 .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/

相关文章:

c# - 最大线程数

c++ - Ultralight - 如何最小化窗口

windows - Windows 上的 Tomcat 控制台输出在哪里

windows - "This program might not have installed correctly"

installation - 在用户桌面上创建带有自定义图标的网站链接

C# 应用程序和汇编 hell !

c# - 获取给定 System.Type 的结构的大小

c# - 如何使用反射访问显式实现的方法?

C# 为什么我可以在常量上调用对象扩展方法?

字节数与字符数