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

Install SQL Server 2017 Silently/with BasicUI

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.47 KiB) Viewed 38049 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.88 KiB) Viewed 38049 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.88 KiB) Viewed 38049 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.19 KiB) Viewed 38049 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.66 KiB) Downloaded 1754 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
Borgas
Posts: 59
Joined: Tue Jan 22, 2008 10:49 pm

Re: Install SQL Server 2017 Silently/with BasicUI

I am trying to add Password and instance name from propert with no success.
When i trying to log to see the install command line it do not log at all.

this is my command line. I have checked that property [SQINSTANCE] and [SQLPWD] is correct


/QS /ACTION=Install /FEATURES=SQL,RS,IS,TOOLS /INSTANCENAME="[SQINSTANCE]" /SQLSVCACCOUNT="NT AUTHORITY\System" /ADDCURRENTUSERASSQLADMIN /AGTSVCACCOUNT="NT AUTHORITY\Network Service" /AGTSVCSTARTUPTYPE=AUTOMATIC /BROWSERSVCSTARTUPTYPE=AUTOMATIC /SAPWD=[SQLPWD] /SECURITYMODE=SQL /SQLCOLLATION=Finnish_Swedish_CI_AS /IACCEPTSQLSERVERLICENSETERMS /ISSVCACCOUNT="NT AUTHORITY\Network Service" /ISSVCSTARTUPTYPE=AUTOMATIC /NPENABLED=1 /TCPENABLED=1 /RSSVCACCOUNT="NT AUTHORITY\Network Service" /RSSVCSTARTUPTYPE=AUTOMATIC
Catalin
Posts: 6958
Joined: Wed Jun 13, 2018 7:49 am

Re: Install SQL Server 2017 Silently/with BasicUI

Hello Boris,

This is happening because the properties from your project are not available when the pre-install prerequisite is installed (before launching your main setup).

Properties are only available for feature-based and post-install prerequisites. With that being said, as a workaround, you can try to add it as a feature-based prerequisite and see if that helps. Please have a look over our "How can I install SQL Server as a feature-based prerequisite" article for information about how you can workaround a possible problem which may occur due to the fact that SQL Server had problems in the past and could not be added as a feature-based prerequisite.

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

Return to “Sample Projects”