當我從創新安裝與運行安裝:確定何時VERYSILENT安裝完成
Installer.exe /VERYSILENT
該命令立即返回,即使安裝大約需要10分鐘。因此,如果我運行:
Installer.exe /VERYSILENT
DoNextThing.exe
DoNextThing.exe在installer.exe仍在安裝時運行。
我想在安裝成功後運行一些配置。眼下,在PowerShell中,我做到以下幾點:
$h = Start-job -name Installer -ScriptBlock {."Installer.exe" /VERYSILENT}
$h # the ps job control commands show this job as complete very quickly
sleep 10
$x = Get-Process -ProcessName Installer
while ($x -and ! $x.HasExited)
{
write-output "waiting ..."
sleep 10
}
# Do some configuration
雖然這似乎是工作,我覺得我必須缺少一個更好的方式來做到這一點。我不想讓它成爲安裝程序的一部分,因爲此配置僅用於Jenkins測試環境。
任何想法,爲什麼powershell工作管理不起作用呢?我是否錯誤地使用了powershell,或者Inno Setup生成的Installer.exe與PowerShell不兼容? [我應該使用cmd.exe而不是PowerShell?]
雖然這確實起作用,但鏈接的問題提供了一個更清晰的管道輸出Out-Null – rkh