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

时间:2013-01-04 11:04:25

标签: .net windows installer windows-installer bootstrapper

我开发了一个.net项目,现在我正在做安装程序。我的项目需要Microsoft SQL 2008或Microsoft SQL 2008 Express。我已经创建了一个安装Microsoft SQL 2008 Express的Bootstrapper,除非有人安装了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>

1 个答案:

答案 0 :(得分:3)

说实话,我不是你想做什么的专家。但SQL服务器发现报告是否适合您? :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>