View Full Version : PRQ Condition Types

05-25-2010, 01:11 PM
I am trying to find documentation regarding the Condition Type properties in the prq files. I need to know what condition will require SQL Server Express 2005 SP2 to be installed with the instance name I specified regardless if another instance of SQL is already installed. My Application a specific instance name to function properly. Below is the contents of my prq files for sql express.
<?xml version="1.0" encoding="UTF-8"?>
<condition Type="32" Comparison="2" Path="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\SQLEXPRESS\MSSQLServer\CurrentVersion" FileName="CurrentVersion" ReturnValue="9.00.3042.00"></condition>
<file LocalFile="&lt;ISProductFolder&gt;\Objects\SQL2005ExpressSP2\SQLEXPR32.EXE" URL="http://saturn.installshield.com/devstudio/setuprequirements/sqlexpress/sp2/SQLEXPR32.EXE" CheckSum="CC50972311E47C2166B3FEEC0675211F" FileSize="0,38220656"></file>
<execute file="SQLEXPR32.EXE" cmdline=" /qb ADDLOCAL=SQL_Engine,SQL_Data_Files,Client_Components SECURITYMODE=SQL INSTANCENAME=MYinstanceName SAPWD=sapw; DISABLENETWORKPROTOCOLS=0 SQLAUTOSTART=1" requiresmsiengine="1"></execute>
<properties Id="Microsoft SQL Server 2005 Express SP2" Description="This installs Microsoft SQL Server 2005 Express Edition SP2 (SQL Server Express). The /qn switch suppresses all Setup dialog boxes and error messages. See http://msdn2.microsoft.com/en-us/library/ms144259.aspx for more information about the commad line options." AltPrqURL="http://saturn.installshield.com/devstudio/setuprequirements/sqlexpress/sp2/121208/microsoft sql server 2005 express sp2.prq"></properties>

05-31-2010, 04:24 PM
You cannot have two SQL Server instances with the same name on the one machine. Therefore you should check whether 'MYinstanceName' is already installed on the target machine and if it is, what is the version.

You can check this via registry key
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MYinstanceName\MSSQLServer\CurrentVersion

Note that detecting sql server instances via registry in not recommended way of detecting SQL Server instances. The right way is to use WMI. However, AFAIK InstallShield does not provide possibility to create conditions based on output of the external app directly (unlike MS SQL Server bootstrapper). If you have MS Windows SDK installed on your system check boostrapper folder, in the SQL Server directory there is a small utility called SqlExpressChk.exe. This utility is used to checked for presence of the SQL Server on the target machine. It communicates with bootstrapper via exit codes. If you wanted to use WMI, you would like to write similar tool with your instance name (SDKs sql checker checks only for the 'SQLEXPRESS' name and is not configurable).