如何防止vc_redist.x ##.exe(VS2017)因挂起的重启而模棱两可地失败? [英] How to prevent vc_redist.x##.exe (VS2017) from ambiguously failing due to pending reboot?
问题描述
TL; DR 是一个由多个安装程序组成的链,用于自动调用VS 2017 vc_redist
的明智方法是什么?
TL;DR What is the sane way to automate invokation of VS 2017 vc_redist
when called in a chain of several installers?
Visual C ++可再发行组件安装程序 MS为VS 15.x(VS 2017)提供的,即 both (14.15.26706-VS 15.8.4)):
The Visual C++ Redistributable Installer that MS provides for VS 15.x (VS 2017), namely both (14.15.26706 - VS 15.8.4)):
-
vc_redist.x86.exe
-
vc_redist.x64.exe
vc_redist.x86.exe
vc_redist.x64.exe
作为完整产品安装的一部分,我必须静默运行几个 vcredist安装程序(也是旧版本).
As part of our full product installation, I have to run several vcredist installers (also older versions) silently.
现在的问题是,这些安装程序将在重新启动处于挂起状态时拒绝安装(例如,"HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager" - PendingFileRenameOperations
).
The problem now is that these installers will refuse to install if a reboot is pending (e.g. "HKLM:\SYSTEM\CurrentControlSet\Control\Session Manager" - PendingFileRenameOperations
).
使用vc_redist /q
调用这些安装程序时,它们将 even 触发立即重启系统.可以通过使用/q /norestart
调用它们来解决此问题,但是:
When calling these installers with vc_redist /q
, they will even trigger an immediate system reboot. This can be fixed by calling them with /q /norestart
, however:
在调用vc_redist /q /norestart
时,如果 prior 挂载到此安装程序,它将返回MSI退出代码3010
,表示需要重新启动.
When calling vc_redist /q /norestart
, and if a reboot is pending prior to this installer, it will return MSI exit code 3010
which indicates that a reboot is required.
,FAIK,此退出代码也表示,此设置需要重新启动才能完成.
However, AFAIK, this exit code also indicates, that this very setup requires a reboot to complete.
因此,我无法区分该安装程序是否成功,并且仅在安装顺序的最后(我确实在安装之前和之后安装过其他东西)之后才需要重新启动-或安装程序是否真的拒绝执行任何操作,我需要重新启动系统并重新启动该安装程序!
So, I cannot distinguish whether this installer was succesful and just requires a reboot at the very end of my installation sequence (I do install otehr stuff before and after) - or whether the installer actually refused to do anything and I would need to restart the system and start this installer again!
如何在一系列不同的第三方安装程序中将该vc_redist称为
How can I call this vc_redist in a chain of different third party installers and
- 理想情况下,最后只需要一次重启
- 至少要确定它是否安装成功.
不确定这些问题,但出于完整性考虑.
Not sure these helkp with the question, but for completeness sake.
- 安装程序GUI清楚地指示正在发生的事情:(抱歉,德语Windows)
未采取任何行动,因为需要重新启动系统."
"No action was taken because a reboot of the system is required."
-
这是我们的产品套件"的InnoSetup内置安装程序,将由客户使用,安装顺序如下:
This is an InnoSetup built installer for our "product suite", that will be used by customers, the installation order goes as follows:
- 运行MSVC 2005(VC8)32位vcredist
- 运行MSVC 2010(VC10)32位vcredist
- 运行MSVC 2017(VC141)64位vcredist
- 运行MSVC 2017(VC141)32位vcredist
- 运行其他一些第三方依赖项/库安装程序
- 安装实际的应用程序文件(通过InnoSetup)
- 重新启动(询问)是否有任何安装程序指示需要重新启动.
从该序列中可以看到,每个vcredist都将疯狂后重新启动,幸运的是,到目前为止,似乎只有2017年的redist表现出这种不幸的行为.
As you can see from this sequence, rebooting after each vcredist woud be insane, and luckily it seems only the 2017 redist exhibits this unfortunate behaviour so far.
的注释:我的试用版在我的开发机上运行,都从步骤0"处的重新启动开始,并且VC2005和VC2010安装程序都运行良好(通过其GUI进度进行了验证) ),即使事先没有重启 .如果挂起重新启动,是VC2017安装程序拒绝执行任何操作.
Of note: My trial runs on my dev machine all started with a reboot already pending at "step 0", and both the VC2005 and VC2010 installer run just fine (as verified through their GUI progress) even if a reboot is pending before hand. It's the VC2017 installers that refuse to do anything if a reboot is pending.
推荐答案
严格来说,错误3010是成功的结果.这意味着安装已完成,但需要重新启动.我不知道有什么迹象表明安装根本没有开始.典型的如果挂起重启,则不会安装"是基于MsiSystemRebootPending属性使用启动条件的结果.由于此启动条件而导致的失败不会返回3010结果-它们通常会返回1602错误,这是一种用户取消"错误.
Strictly speaking, error 3010 is a success result. It means that the install has completed but requires a reboot. I'm not aware of anything to indicate that it means the install didn't start at all. The typical "won't install if reboot pending" is a result of using a launch condition based on the MsiSystemRebootPending property. Failures due to this launch condition do not return return a 3010 result - they usually return a 1602 error as a kind of "user cancel" error.
这篇关于如何防止vc_redist.x ##.exe(VS2017)因挂起的重启而模棱两可地失败?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!