How to silently install the SQL Server Express 2019 Prerequisite into the main installation package?

ImportantThe following article uses options that are available starting with the Enterprise edition and project type.

Silent installations are a helpful way to eliminate unnecessary notifications or messages for the end-users. They are particularly useful when installing prerequisites that help your application to work properly.

Depending on your specific situation, you might want to silently include these prerequisites in the installation package rather than notifying the user that the installation will not continue.

With that in mind, in this article, we will focus on carrying out a silent installation of the SQL Server Express, one of the most popular prerequisites currently available.

Note Advanced Installer offers a vast list of Predefined Prerequisites that can easily be included in the installation package

Let's go through how you can use Advanced Installer's GUI to silently install "SQL Server Express 2019" without the need for any user interaction.

1. How To Include the SQL Server Express 2019 Prerequisite in your package?

Go to the Prerequisites section from the left pane, under Requirements -- as seen in the image below.

Prerequisites page SQL Server

Once there, we can get started:

1. From the Predefined Prerequisites list, scroll down and check SQL Server Express 2019 (not the web installer).

Download prerequisite SQL Server

2. Choose Yes when prompted with the Download prerequisite and include in package? pop-up (seen in the image above). This step makes sure that the prerequisite is included in the package so it can be installed offline.

3. Once the Prerequisite is downloaded, check your project location and make sure that it is listed under the Pre-install folder of the Prerequisites.

Pre-install folder

2. Configuring the Setup Files for the Silent Installation

Once the SQL Server Express 2019 prerequisite is added to our installation package, we can configure the settings to ensure a fully silent installation of the main installer package (when triggered with the silent parameters).

To set that up, follow these steps:

1. From the same page, click on SQL Server Express 2019 and navigate to the Setup Files tab.

Setup files SQL Server

2. Focus on the Install Command Lines. The trick here is to pass the parameters to the SQL setup.

ImportantYou must use the same parameters for Full UI, Basic UI, and Silent (no UI). So, when the main installer package is called, whether you pass the silent parameters or not, it will trigger the SQL Server Express 2019 using the same parameters declared in the Install Command Lines. For a complete list of SQL Server parameters, you can check the official Microsoft documentation here.

3. Preconfigure the Parameters for the SQL Server

As a best practice, when you perform a silent installation of SQL Server, you also want to preconfigure it. Find the most common install command line here:

/x:C:\ExtractionFolder /qs /ACTION=INSTALL /FEATURES=SQL /INSTANCENAME=MSSQLSERVER /SQLSVCACCOUNT="<ComputerName/DomainName>\<UserName>" /SQLSVCPASSWORD="<password>" /SQLSYSADMINACCOUNTS="<ComputerName/DomainName>\<UserName>" /AGTSVCACCOUNT="NT AUTHORITY\Network Service" /SQLSVCINSTANTFILEINIT="True" /IACCEPTSQLSERVERLICENSETERMS

Let’s break down the command line a little bit and explain what most parameters represent:

/x:C:\ExtractionFolder

SQL Server is a self-extracting executable. This parameter shows where it should extract the files. This was a known issue of the previous version of SQL Server Express ( 2015, 2017, and older). Without passing this argument, it would always ask for the location where you want the setup to be extracted.

/qs 

The above parameter controls the level of GUI display during the install. It will only display the setup progress but will not allow you to add any input or show any error messages. If you want a fully silent install with no dialog display, use the /qs parameter.

All of these values should be replaced with the actual computer, domain, username, and password information.

<ComputerName/DomainName>\<UserName> <password>

Your Install Command Lines should look something like this in the end:

Install Command Line SQL Server

4. Silently install your application package with the SQL Server Express 2019 as a prerequisite

Now that you have included and configured the SQL prerequisite in your installation package, you can make any other configurations and build the installer as a single .exe file.

The main setup can then be triggered with the silent parameters that Advanced Installer accepts (Windows Installer parameters are also accepted). This way, your application package can easily be integrated into Configuration Management Tools such as Microsoft Endpoint Configuration Manager, Ivanti Landesk, Emporium Matrix42, etc.

For this tutorial, we will use a cmd to trigger the installation.

“Your Application.exe” /exenoui /qb! /l*v “install.log”

Trigger installation from cmd

This command silently installs the SQL Server express first, and the main app component second.

5. Conclusion

After following the steps listed above, you're done! The SQL Server Express 2019 prerequisite is added and you can trigger the installation silently.

From Advanced Installer's GUI, you can directly add any supported prerequisites.

Have any questions or suggestions for topics we can discuss? Tell us!

6. Video tutorial