This is currently what I use to install SqlExpress 2008 R2 as part of my bundle:
<ExePackage Id="SqlExpress2008R2"
Cache="no"
Compressed="no"
PerMachine="yes"
Permanent="no"
Vital="yes"
InstallCommand="/QS /ACTION=Install /IACCEPTSQLSERVERLICENSETERMS /BROWSERSVCSTARTUPTYPE=Automatic /SQLSVCSTARTUPTYPE=Automatic /FEATURES=SQL /INSTANCENAME=[SqlInstance] /SQLSVCACCOUNT="NT AUTHORITY\Network Service" /SQLSYSADMINACCOUNTS="BUILTIN\ADMINISTRATORS" /AGTSVCACCOUNT="NT AUTHORITY\Network Service" /SECURITYMODE=SQL /SAPWD="[SqlAdminUserPassword]""
Name="redist\SQLEXPR_x86_ENU.exe"
DownloadUrl="http://download.microsoft.com/download/D/1/8/D1869DEC-2638-4854-81B7-0F37455F35EA/SQLEXPR_x86_ENU.exe"
InstallCondition="NOT SQLServer2008R2Installed AND NOT SQLServerInstalled">
<RemotePayload ProductName="SQL Server 2008 R2 Express SP1"
Description="SQL Server 2008 R2 Express SP1"
CertificatePublicKey="5C499B10F7EF186DC729991A262AB52066423909"
CertificateThumbprint="93859EBF98AFDEB488CCFA263899640E81BC49F1"
Hash="6F399D641F322A3E47E3DD605F2A2EDF21074375"
Size="111274848"
Version="10.50.2500.0" />
</ExePackage>
The parts in the InstallCommand
attribute surrounded with square-brackets (e.g. [SqlInstance]
) are supplied by the bundle variables that can be supplied to the bundle exe on the command-line:
<Variable Name="SqlInstance"
Value="SQLEXPRESS"
bal:Overridable="yes" />
Note the important attribute bal:Overridable="yes"
this means that it can be set via the bundles command-line, without it it will just be an internal variable (set by registry search for example).