Share via

how to fix this sqlserver 2019 installation detectPreviousRulesDownloadActivityFatalExceleption issues.

yinxu wang 20 Reputation points
2026-01-16T10:51:30.9466667+00:00

hey there ,

I'm writing a PowerShell script to execute the installer to install a sqlserver2019. I use the following command to run it.

C:\SQL2019-SSEI-Expr.exe /Q /IACCEPTSQLSERVERLICENSETERMS /CONFIGURATIONFILE=C:\Configuration.ini

config in Configuration.ini is

[OPTIONS]

ACTION="install"

SECURITYMODE=SQL

SAPWD="MYPASSWORD**"

FEATURES=SQLEngine

INSTANCENAME=SQLEXPRES

But i got this error

The main process of the SQL installation package failed to execute. Exit code:-1 + CategoryInfo : NotSpecified: (:) [Write-Error], WriteErrorException + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,test.ps1

i find logs here

C:\Program Files\Microsoft SQL Server\150\SSEI\LogFiles\

i got this error detail

User's image

and I have already checked, and no other installer is currently running.

What are the next steps I should take to resolve this problem? Thanks

SQL Server Database Engine
0 comments No comments

Answer accepted by question author

Marcin Policht 92,635 Reputation points MVP Volunteer Moderator
2026-01-16T12:13:14.17+00:00

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

Was this answer helpful?

1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.