Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bypass installation of SQLExpress if there's an instance of Microsoft SQL Server

I've developed a .net project and now im doing the installer. My project requires either Microsoft SQL 2008 or Microsoft SQL 2008 Express. I've created a Bootstrapper that installs the Microsoft SQL 2008 Express and it works fine except when someone has Microsoft SQL 2008 already installed. How can i bypass the installation if Microsoft SQL 2008 is already installed?

Edit: This solution works for 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>
like image 711
jsaye Avatar asked Oct 21 '22 20:10

jsaye


1 Answers

To be honest I am not an expert in what your trying to do. But would the SQL server discovery report work for you? : SQL server discovery report

or

determine-installed-sql-server-instances

Edit:

I was thinking about something like:

<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>
like image 50
Kevin Hendricks Avatar answered Oct 27 '22 01:10

Kevin Hendricks