具有-Wait安装的msiexec持续失败

时间:2018-12-05 09:46:13

标签: powershell silent-installer

有我的剧本:

try {
    Start-Process "C:\tmp\_deployment\AcroRdrDC1900820071_hu_HU.exe" -argumentlist '/sALL /EULA_ACCEPT=YES /qn"' -PassThru -Wait
} catch {
    Write-Host "mypatch.exe returned the following error $_"
    Throw "Aborted mypatch.exe returned $_"
}

try {
    Start-Process "C:\tmp\_deployment\Office 2016 Prof Plus 64bit HUN\setup.exe" -Verb runAs -PassThru -Wait
} catch {
    Write-Host "mypatch.exe returned the following error $_"
    Throw "Aborted mypatch.exe returned $_"
}

try {
    Start-Process "C:\tmp\_deployment\jre-8u181-windows-x64.exe" -ArgumentList '/s INSTALL_SILENT=1 STATIC=0 AUTO_UPDATE=0 WEB_JAVA=1 WEB_JAVA_SECURITY_LEVEL=H WEB_ANALYTICS=0 EULA=0 REBOOT=0 NOSTARTMENU=0 SPONSORS=0' -PassThru -Wait
} catch {
    Write-Host "mypatch.exe returned the following error $_"
    Throw "Aborted mypatch.exe returned $_"
}

Start-Process msiexec.exe -PassThru -Wait -ArgumentList '/I C:\tmp\_deployment\7z1805-x64.msi /passive'


Start-Process msiexec.exe -PassThru -Wait -ArgumentList '/I C:\tmp\_deployment\tightvnc-2.8.11-gpl-setup-64bit.msi /quiet /norestart'

在7zip安装完成之前,一切都很好。完成后的下一个过程-tightvnc-不安装到计算机上。一切都很好,直到7zip安装完成。当下一个过程(tightvnc)开始时,安装将立即退出,tightvnc在计算机上不可用。

我试图以此更改最后几行:

 msiexec.exe /I C:\tmp\_deployment\tightvnc-2.8.11-gpl-setup-64bit.msi /quiet /norestart -Wait

但是什么都没有。 如果仅运行最后一行,tightnc安装将成功。

我认为-Wait参数不起作用。知道我该如何解决吗? 如果有人知道如何简化此脚本,我将不胜感激! 感谢您的帮助。

0 个答案:

没有答案