简体   繁体   English

从InstallShield项目中调用Powershell脚本

[英]Calling a powershell script from InstallShield project

I'm having a weird problem. 我有一个奇怪的问题。

I have an InstallShield project (which creates setup.exe) that contains a custom action item - calling a powershell script. 我有一个InstallShield项目(创建setup.exe),其中包含一个自定义操作项-调用Powershell脚本。

All the script does is to install 3 adobe reader updates (1 exe file and 2 msp files) on top of the already installed Adobe Reader 11.0.0. 该脚本所做的只是在已安装的Adobe Reader 11.0.0之上安装3个Adobe Reader更新(1个exe文件和2个msp文件)。

When I'm calling the script my self - it works fine. 当我自己调用脚本时,它可以正常工作。

However, after the setup.exe finishes, it seems like only one update (the exe file) was really installed (the adobe reader version after the install is 11.00.10 which is the result of running only the exe file..). 但是,setup.exe完成后,似乎只真正安装了一个更新(exe文件)(安装后的adobe reader版本为11.00.10,这是仅运行exe文件的结果。)。

All 3 adobe updates sit in the same folder and the powershell script first sets it location to this folder. 所有3个Adobe更新都位于同一文件夹中,并且Powershell脚本首先将其位置设置为此文件夹。 When running the updates manually after the installation - it also works fine and updates it to 10.00.22 (what it should be). 在安装后手动运行更新时-它也可以正常工作并将其更新为10.00.22(应该是)。

Any ideas why is this happening? 任何想法为什么会这样?

Here's my powershell script: 这是我的powershell脚本:

    Set-Location  "C:\myProject\adobeUpdates"

Start-Process .\AdbeRdr11010_en_US.exe -ArgumentList '/q /norestart /sPB /rs /msi' -WindowStyle hidden -Wait

ping 1.1.1.1 -n 1 -w 10000  # Tried to add a delay but wasn't helpful

Start-Process -FilePath “AdbeRdrUpd11021.msp” -ArgumentList '/qn' -Wait

Start-Process -FilePath “AdbeRdrUpd11022_incr.msp” -ArgumentList '/qn' -Wait

Thank you very much 非常感谢你

Solved it, this is the working script: 解决了,这是工作脚本:

 Set-Location  "C:\myProject\adobeUpdates"

Start-Process .\AdbeRdr11010_en_US.exe -ArgumentList '/q /norestart /sPB /rs /msi' -WindowStyle hidden -Wait

ping 1.1.1.1 -n 1 -w 10000

Start-Process .\AdbeRdrUpd11021.msp -ArgumentList '/qn' -Wait

Start-Process .\AdbeRdrUpd11022_incr.msp -ArgumentList '/qn' -Wait

I'm not sure what is the different and would love someone to explain but anyway it works just fine now. 我不确定有什么不同,不希望有人来解释,但无论如何现在都可以了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM