Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ExitCode 1603 when silently installing a .msi

I'm trying to write a script that installs a .msi silently. When I run the command from the Powershell command line as a ./thing.msi with the argument /qn, it works just fine. However, now that it is in a script it is returning a 1603 error ("A fatal error occurred during install"). If I try to switch it up and go to /qb with or without /quite, it runs, but it's not silent. Using -WindowStyle Hidden is doing nothing of note either. Any thoughts?

$InsightInstall = Start-Process -FilePath $PSScriptRoot\support.msi -
ArgumentList "/quiet /qb" -Wait -Passthru -WindowStyle Hidden
if($InsightInstall.ExitCode -eq 0)
{
    Write-Host "Installation complete."
}
else
{
    Write-Host "Failed with ExitCode" $InsightInstall.ExitCode
    pause
}
like image 382
ConwayK Avatar asked Oct 27 '25 05:10

ConwayK


1 Answers

You don't need to try that hard (I don't think Start-Process is needed). Just run msiexec and specify the package, followed by parameters.

msiexec /i d:\path\package.msi /quiet
like image 53
Bill_Stewart Avatar answered Oct 29 '25 22:10

Bill_Stewart



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!