Core component of SQL Server for storing, processing, and securing data
As far as I can tell, what is failing here is not your configuration options but the bootstrapper you are using. SQL2019-SSEI-Expr.exe is the SSEI web bootstrap installer (the small downloader). My understanding is that it's not supported for fully unattended / quiet installs with a configuration file. When run with /Q it still tries to execute interactive bootstrap activities such as DetectPreviousRulesDownloadActivity, which is exactly where your log shows a NullReferenceException. That exception is a known behavior of SSEI when forced into silent mode.
This is why you see:
The main process of the SQL installation package failed to execute
Exit code: -1
and in the log:
DetectPreviousRulesDownloadActivity fatalException
NullReferenceException
Microsoft.Sql.Installer.Engine.Utils.GetDownloadFolder()
The fix would be to switch to the full media installer, which is the only supported method for unattended SQL Server installs.
First, download the full SQL Server 2019 Express media. You can do this either via Microsoft’s download page by choosing “Download Media” → “ISO”, or by using the SSEI interactively one time and selecting “Download Media” instead of “Install”.
Once extracted, you will have a folder containing setup.exe.
Then run setup.exe, not SQL2019-SSEI-Expr.exe.
Your command should look like this:
C:\SQL2019\setup.exe /Q /IACCEPTSQLSERVERLICENSETERMS /CONFIGURATIONFILE=C:\Configuration.ini
Your configuration file is mostly fine, but you should add a few required and recommended options to avoid secondary failures:
[OPTIONS]
ACTION="Install"
FEATURES=SQLEngine
INSTANCENAME=SQLEXPRESS
SECURITYMODE=SQL
SAPWD="MYPASSWORD**"
SQLSYSADMINACCOUNTS="BUILTIN\ADMINISTRATORS"
TCPENABLED=1
NPENABLED=0
ENU="True"
Make sure PowerShell is running as Administrator.
If you want to capture a clean exit code in PowerShell, use:
$process = Start-Process -FilePath "C:\SQL2019\setup.exe" `
-ArgumentList '/Q /IACCEPTSQLSERVERLICENSETERMS /CONFIGURATIONFILE=C:\Configuration.ini' `
-Wait -PassThru
$process.ExitCode
Expected success exit code is 0.
If the above response helps answer your question, remember to "Accept Answer" so that others in the community facing similar issues can easily find the solution. Your contribution is highly appreciated.
hth
Marcin