Msiexec 无法运行(使用 NANT 生成的命令)
以下用于使用 nant 生成 msiexec 命令:
> "<exec program="msiexec"
> timeout="1800000" verbose="true">
> <arg line="/i "${server.msi}"" />
> <arg line="TARGETDIR="${server.target.path}""
> />
> <arg line="INSTALLDIR="${server.target.path}""
> />
> <arg line="ALLUSERS=1" />
> <arg line="/quiet" />
> <arg line="/log "${path::combine(log.path,
> 'Installation.Server.log')}"" />"
</exec>
生成的命令是: msiexec ( /i "S:\Work\Sources\Installation\Setup\LastBuild\WiseSetup Server.msi" TARGETDIR="C:\Program Files\MyProgs\Server" INSTALLDIR="C:\Program Files\MyProgs\Server" ALLUSERS =1; /quiet /log "C:\Projects\P3450\Environment\Logs\Installation.Server.log")
当/quiet(或/qn)被删除时,此命令无法执行,但运行成功。否则会给出错误: 外部程序失败:msiexec(返回代码为 1619)
请注意,“(”和“)”已被删除,并且 /quiet 在那里,它运行成功!
The following is used to generate an msiexec command with nant:
> "<exec program="msiexec"
> timeout="1800000" verbose="true">
> <arg line="/i "${server.msi}"" />
> <arg line="TARGETDIR="${server.target.path}""
> />
> <arg line="INSTALLDIR="${server.target.path}""
> />
> <arg line="ALLUSERS=1" />
> <arg line="/quiet" />
> <arg line="/log "${path::combine(log.path,
> 'Installation.Server.log')}"" />"
</exec>
Th generated command is:
msiexec ( /i "S:\Work\Sources\Installation\Setup\LastBuild\WiseSetup Server.msi" TARGETDIR="C:\Program Files\MyProgs\Server" INSTALLDIR="C:\Program Files\MyProgs\Server" ALLUSERS=1; /quiet /log "C:\Projects\P3450\Environment\Logs\Installation.Server.log")
this command fails to execute when the /quiet (or /qn) is removed it runs successful. Otherwise it gives the error:
External Program Failed: msiexec (return code was 1619)
Note that of the "(" and ")" is removed and the /quiet is there it runs successful !
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
使用 /l*v 命令(而不仅仅是 /log)启用详细日志记录,打开 msi 日志文件(“Installation.Server.log”),然后搜索“返回值 3”以直接跳转到安装程序失败的位置。如果需要,您还可以使用 Windows 安装程序详细设置日志分析器来分析日志文件。
Enable verbose logging using the /l*v command instead of just /log, open your msi log file ("Installation.Server.log"), and then search for "return value 3" to jump directly to where the setup installer failed. You can also use the windows installer verbose setup log analyzer to analyze the log file if needed.
根据文档,错误代码 1619 表示无法打开该包。
这通常意味着,当 nant 尝试执行 msiexec 时,其他东西在文件上打开了锁 - 如果其他人将 Windows 资源管理器打开到
S:\,那么这是一个常见问题在您的示例中,Work\Sources\Installation\Setup\LastBuild\WiseSetup Server.msi
,它可能只是尝试生成缩略图。在执行此 nant 任务之前坚持超时/等待,看看是否有帮助,如果有的话,那么其他东西已经保留了您的文件 - 这也可以解释为什么当您手动运行命令时它会成功,锁已被释放时间。
As per the documentation, error code 1619 indicates that the package cannot be opened.
What this usually means, is that something else has a lock open on the file at the time nant is trying to execute msiexec - a common problem if anyone else has Windows Explorer open to
S:\Work\Sources\Installation\Setup\LastBuild\WiseSetup Server.msi
in your example, it's probably just trying to generate a thumbnail.Stick a timeout/wait in before executing this nant task and see if that helps, if so then something else has a hold on your file - this would also explain why it succeeds when you run the command manually, the lock has been released by that time.