colin.miller
Posts: 7
Joined: Sun Nov 27, 2022 8:27 pm

Optionally install SQL Server Express 2017

Hello,

In the past I have successfully installed SQL Server Express 2017 as a prerequisite, but I was wondering if it is possible to "optionally" install SQL Server Express 2017? The use case would be that they click a button on one of the dialogs and it automatically installs SQL Server Express 2017 onto the target machine with predefined parameters. Currently I have it as a custom action that runs the SQL2017EXPR.exe file with some command line flags but the problem is that it fails out instantly and never actually installs anything. Could I get some assistance with this? My command line arguments are as follows:

/q /IACCEPTSQLSERVERLICENSETERMS /ACTION=install /FEATURES=SQLEngine /INSTANCENAME=TestInstanceName /SECURITYMODE=SQL /SAPWD="testPassword" /SQLSYSADMINACCOUNTS="NT Authority\System" /ADDCURRENTUSERASSQLADMIN=True
Liviu
Posts: 1048
Joined: Tue Jul 13, 2021 11:29 am
Contact: Website

Re: Optionally install SQL Server Express 2017

Hello Colin,

Starting with the Microsoft SQL Server 2012 Service Pack 2 (SP2), the SQL Setup can be installed as a feature-based prerequisite. This means you can condition its installation.

The SkipInstallerRunCheck command line parameter needs to be passed to the SQL prerequisite through the Install Command Line section of the prerequisite Setup Files tab in order to avoid the Windows Installer handle check of the SQL prerequisite.

You can add our "SQL Server Express 2017" predefined prerequisite as a feature-based prerequisite and pass the desired command line to it. Do not forget the SkipInstallerRunCheck command.
sql.png
sql.png (60.95 KiB) Viewed 10528 times

After that, you can add the desired condition for the prerequisite feature from the Organization page:
feature condition.png
feature condition.png (56.19 KiB) Viewed 10528 times
In my case, the installation was conditioned by a Checkbox palced on a dialog.

For more details regarding the silent installation of the SQL Server Express, you can check our How to silently install the SQL Server Express 2019 Prerequisite into the main installation package?
article and the video tutorial: https://www.youtube.com/watch?v=O5Ch7-3fM4U

Let me know if you have any questions.

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
colin.miller
Posts: 7
Joined: Sun Nov 27, 2022 8:27 pm

Re: Optionally install SQL Server Express 2017

Thank you for the reply. I have since upgraded to v21.1 of Advanced Installer and it appears some things have changed. I added the SQL Server Express 2017 prerequisite as you instructed with the appropriate command lines but I do not see the corresponding feature in the organization page. Please advise. Also if you could update your screenshots to conform to the ui changes in v21.1 that would be helpful as well.
screen1.png
screen1.png (31.39 KiB) Viewed 8950 times
screen2.png
screen2.png (15.89 KiB) Viewed 8950 times
Liviu
Posts: 1048
Joined: Tue Jul 13, 2021 11:29 am
Contact: Website

Re: Optionally install SQL Server Express 2017

Hello,

I'm afraid that with the new changes to Prerequisites support, SQL Server prerequisites are considered framework type and cannot be added to run as feature-based (during main package).

However, to overcome this, you can add the package yourself under the Main Package section (do not use our predefined list). You can add our predefined prerequisite and copy all its settings into a new prerequisite. After you add the prerequisite from our list, click on the "New Package from URL" toolbar button and copy with the Ctrl-C shortcut the URL and install conditions.

Do not forget to add the /SkipInstallerRunCheck parameter.
sql server.png
sql server.png (224.46 KiB) Viewed 8936 times

After that you can see the feature in the Organization page:
sql feature.png
sql feature.png (161.31 KiB) Viewed 8936 times

Hope this helps!

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”