Catalin
Posts: 6506
Joined: Wed Jun 13, 2018 7:49 am

Install SQL Server 2017 Silently/with BasicUI

Fri Dec 28, 2018 2:13 pm

Hello guys,

One frequently asked question that we often receive is how to install SQL Server silently alongside your Advanced Installer project (as a prerequisite). Given the amount of requests on this, today I will explain, step by step, how to silently install SQL Server 2017.

First thing we need to do is to download Microsoft SQL Server Express from the official site:
Download Link.PNG
Download Link.PNG (289.47KiB)Viewed 174994 times
As of today's date (28/12/2018), a valid download link for the Microsoft SQL Server Express is:

https://www.microsoft.com/en-us/downloa ... x?id=55994

After the download has successfully ended, open the "SQLServer2017-SSEI-Expr.exe". After doing so, you will be prompted to choose between an installation type, as in the following screenshot. Here, you need to choose "Download Media":
Download Media.PNG
Download Media.PNG (144.88KiB)Viewed 174994 times
After you click on "Download Media", you will be prompted to chose the download location as in the following screenshot:
Choose Download Location.PNG
Choose Download Location.PNG (73.88KiB)Viewed 174994 times
After choosing the download location, click on the "Download" button. After the download is complete, press on the "Open folder" button, which will open the location where the SQL Server 2017 installer has been downloaded:
Press Open folder.PNG
Press Open folder.PNG (29.19KiB)Viewed 174994 times
The setup that we are looking for is "SQLEXPR_x64_ENU". This is the setup that we will use in our Advanced Installer project as a prerequisite.

How to implement the solution:

1- Open a new/your existing Advanced Installer project.

2- Go to "Prerequisites" page

3- Right click on "Pre-Install" prerequisite type from under "Packages" section --> "New package prerequisite ..." --> select the "SQLEXPR_x64_ENU" setup (from the path where you have downloaded it).

Here comes the interesting part: In order to install SQL Server silently, we have to pass some parameters to the SQL setup. For a full list of the parameters that can be passed to the SQL setup, please see the "Install SQL Server from the Command Prompt" article.

4- After you have added the SQL Setup as a pre-install prerequisite, it is time to pass the parameters to it. To do so, please go to "Setup FIles" tab and, under the "Install Command Lines" section, please input the following command for all the three fields (Full UI, Basic UI, Silent):

Code: Select all

/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
As you can see above, the script is missing some crucial information, like "<ComputerName/DomainName>" and "<password>", information which you will need to introduce accordingly.

The "/qs" parameter Specifies that setup runs and shows progress through the UI, but does not accept any input or show any error messages. If you want a completely silent installation, you can pass the "/q" parameter instead.

One very important command line switch here is the following: "/x:C:\ExtractionFolder". Since the "SQLEXPR_x64_ENU" is a self-extracting executable, it will always ask for the location where the "setup.exe" should be extracted. This was troublesome to pretty much everyone who wanted to install SQL Server completely silent, due to little to no documentation on it (the command line switch).

Attached below, for your reference, the sample AIP file that implements those said above:
Your Application.aip
(20.66KiB)Downloaded 3137 times
All the modifications that are needed for the above project are:

1- To pick the "SQLEXPR_x64_ENU" from the location where you have downloaded it. To do so, simply go to "Prerequisites" page, click on "Microsoft SQL Server 2017 Express" and then, under "Main Setup File" section, press the "..." button which is located to the right side of the "File path:" field.

2- To modify the "<ComputerName/DomainName>", "<password>" and the extraction folder path ("/x:C:\ExtractionFolder") from within the command line switches that are passed to the "setup.exe".

Hope this helps.

All the best,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Sample Projects”