Reputation: 41
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
}
Upvotes: 4
Views: 10978
Reputation: 24515
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
Upvotes: 2