[wix-users] Bootstrapping SQL Express 2019 from WiX?
Wiles, Dean
dean.wiles at compucom.com
Tue Sep 29 09:38:04 PDT 2020
Unfortunately, there were no replies to this inquiry and no examples found
anywhere for bootstrapping the 2019 version of SQL Server Express, however
I did get it to work. Below are my findings and the WiX code I pieced
together:
There were some online examples for the 2012/2014 versions, but Microsoft
now has an additional wrapper for SQL Express (SQL2019-SSEI-Expr.exe
wraps SQLEXPR_x64_ENU.exe).
SQLEXPR_x64_ENU.exe (for version 2019) does not have a published download
Url, but it can be deduced using Fiddler. BTW, the SQL Server 2019 Express
links on http://downloadsqlserverexpress.com/ are not current; they should
now be:
SQL Server 2019 Express Edition (English):
- Express Core (255 MB)
https://download.microsoft.com/download/8/4/c/84c6c430-e0f5-476d-bf43-eaaa222a72e0/SQLEXPR_x64_ENU.exe
- Express Advanced (796 MB)
https://download.microsoft.com/download/8/4/c/84c6c430-e0f5-476d-bf43-eaaa222a72e0/SQLEXPRADV_x64_ENU.exe
- LocalDB (53 MB)
https://download.microsoft.com/download/8/4/c/84c6c430-e0f5-476d-bf43-eaaa222a72e0/SqlLocalDB.msi
NB: The downloaded file for SqlLocalDB.msi did not change even though the
URL did.
There is no command-line documentation for either SQL2019-SSEI-Expr or
SQLEXPR_x64_ENU, but I have requested it at
https://github.com/MicrosoftDocs/sql-docs/issues/5477.
SQL Server 2019 Express is 64-bit only, but the WiX Bootstrapper project
defaults to 32-bit, so be sure to include Win64="yes" in any RegistrySearch
for SQL registry keys.
In my main Bundle.wxs, I put the following inside the <Chain> node:
<!--Installs SQL Server 2019 Express using web installer-->
<PackageGroupRef Id="Sql2019ExprWeb" />
I then put all the WiX code for SQL Server 2019 Express in a separate file
named SQL2019Expr.wxs:
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="
http://schemas.microsoft.com/wix/UtilExtension">
<!--
SQL Server 2019 Express installation state properties
Official documentation can be found at the following location:
SQL Server 2019 -
https://www.microsoft.com/en-us/sql-server/sql-server-2019
-->
<?define SqlServerInstance=SQLEXPRESS ?>
<?define Sql2019ExprDownloadUrl=
https://download.microsoft.com/download/8/4/c/84c6c430-e0f5-476d-bf43-eaaa222a72e0/SQLEXPR_x64_ENU.exe
?>
<?define Sql2019ExprInstallCommand=/ACTION=Install /QS
/IACCEPTSQLSERVERLICENSETERMS /ENU /FEATURES=SQLENGINE
/INSTANCENAME=$(var.SqlServerInstance)
/SQLSYSADMINACCOUNTS=BUILTIN\Administrators ?>
<?define Sql2019ExprUninstallCommand=/ACTION=Uninstall /QS /ENU
/FEATURES=SQLENGINE /INSTANCENAME=$(var.SqlServerInstance) ?>
<?define Sql2019ExprRepairCommand=/ACTION=Repair /QS /ENU
/FEATURES=SQLENGINE /INSTANCENAME=$(var.SqlServerInstance) ?>
<Fragment>
<util:RegistrySearch
Id="SqlInstanceFound"
Root="HKLM"
Key="SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\SQL"
Value="$(var.SqlServerInstance)"
Result="exists"
Variable="SqlInstanceFound"
Win64="yes" />
<PackageGroup Id="Sql2019ExprWeb">
<ExePackage
Id="SQLSERVER"
DownloadUrl="$(var.Sql2019ExprDownloadUrl)"
Name="SQLEXPR_x64_ENU.exe"
Compressed="no"
DetectCondition="SqlInstanceFound"
Permanent="yes"
InstallCommand="$(var.Sql2019ExprInstallCommand)"
UninstallCommand="$(var.Sql2019ExprUninstallCommand)"
RepairCommand="$(var.Sql2019ExprRepairCommand)">
<!--If you want to uninstall Server 2019 Express when uninstalling
your bundle, then set Permanent="no" in the ExePackage node above-->
<RemotePayload
Description="Microsoft SQL Server 2019 Express"
ProductName="Microsoft SQL Server 2019 Express"
Version="15.0.2000.5"
Size="268090448"
Hash="004a55528a3d38224b71c2de0d1a3291daef5e0f" />
</ExePackage>
</PackageGroup>
</Fragment>
</Wix>
The conditional install of SQL Server 2019 Express worked well, but the
uninstall was problematic on my machine so I excluded it. I have not tried
repairs or upgrades yet.
Hopefully, this will help save someone else some time...
Cheers,
Dean
On Thu, Aug 20, 2020 at 9:59 AM Wiles, Dean <dean.wiles at compucom.com> wrote:
> Are there any working examples of Bootstrapping SQL Express 2019 from WiX?
>
> Google found a few examples of installing earlier SQL versions (e.g.
> https://stackoverflow.com/questions/18930854/bootstrapping-sql-express-from-wix),
> however with SQL 2019, Microsoft only makes the latest version directly
> downloadable via SQL2019-SSEI-Expr.exe (
> https://go.microsoft.com/fwlink/?linkid=866658).
>
> From the SQL2019-SSEI-Expr command line, it can download and install SQL
> using a config file:
> SQL2019-SSEI-Expr.exe /IAcceptSqlServerLicenseTerms /Quiet
> /ConfigurationFile="SQL2019ExpressConfig.ini"
>
> Anyway, I'm looking for an example of how that is all put together in WiX,
> including how to download the latest SQL2019-SSEI-Expr.exe, similar to how
> it works for NetFx48Web (the .NET 4.8 download & install) in NetFx48.wxs?
>
> Thanks!
>
> *Dean Wiles | CompuCom*
> Financial & Business Software Development, Programming Advisor
> direct: 509.927.5637 fax: 509.922.0930
> Dean.Wiles at CompuCom.com
> 8775 E. Mission Ave, Spokane Valley, WA 99212-2531
> www.CompuCom.com <http://www.compucom.com/>
>
> Out Of Office Alert: Fridays, August 21 - September 4, 2020
>
--
CONFIDENTIALITY NOTICE: The information contained in this email and
attached document(s) may contain confidential information that is intended
only for the addressee(s). If you are not the intended recipient, you are
hereby advised that any disclosure, copying, distribution or the taking of
any action in reliance upon the information is prohibited. If you have
received this email in error, please immediately notify the sender and
delete it from your system.
More information about the wix-users
mailing list