如何防止 vc_redist.x##.exe (VS2017) 由于挂起的重新启动而出现模棱两可的失败? [英] How to prevent vc_redist.x##.exe (VS2017) from ambiguously failing due to pending reboot?

查看:19
本文介绍了如何防止 vc_redist.x##.exe (VS2017) 由于挂起的重新启动而出现模棱两可的失败?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

TL;DR在多个安装程序链中调用时自动调用 VS 2017 vc_redist 的明智方法是什么?

<小时>

<块引用>

未采取任何措施,因为需要重新启动系统."

  • 这是我们的产品套件"的 InnoSetup 内置安装程序,供客户使用,安装顺序如下:

    1. 运行 MSVC 2005 (VC8) 32 位 vcredist
    2. 运行 MSVC 2010 (VC10) 32 位 vcredist
    3. 运行 MSVC 2017 (VC141) 64 位 vcredist
    4. 运行 MSVC 2017 (VC141) 32 位 vcredist
    5. 运行一些其他第三方依赖/库安装程序
    6. 安装实际的应用程序文件(通过 InnoSetup)
    7. 重启(询问)是否有安装程序指示需要重启.

从这个序列中可以看出,每次 vcredist 后重新启动都会很疯狂,幸运的是,到目前为止,似乎只有 2017 年的 redist 表现出这种不幸的行为.

注意:我在开发机器上运行的试用版都是从步骤 0"处已经挂起的重启开始的,VC2005 和 VC2010 安装程序运行良好(通过他们的 GUI 进度验证)) 即使重新启动 事先未决.如果重启未决,VC2017 安装程序会拒绝执行任何操作.

解决方案

严格来说,error 3010是成功的结果.这意味着安装已完成,但需要重新启动.我不知道有任何迹象表明这意味着安装根本没有开始.典型的如果重新启动挂起将不会安装"是使用基于 MsiSystemRebootPending 属性的启动条件的结果.由于此启动条件导致的失败不会返回 3010 结果 - 它们通常会返回 1602 错误作为一种用户取消"错误.

TL;DR What is the sane way to automate invokation of VS 2017 vc_redist when called in a chain of several installers?


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

As part of our full product installation, I have to run several vcredist installers (also older versions) silently.

The problem now is that these installers will refuse to install if a reboot is pending (e.g. "HKLM:SYSTEMCurrentControlSetControlSession Manager" - PendingFileRenameOperations).

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:

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.

However, AFAIK, this exit code also indicates, that this very setup requires a reboot to complete.

Actual question

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!

How can I call this vc_redist in a chain of different third party installers and

  • ideally require just one reboot at the very end
  • at the very least, determine whether it installed successfully.

Some additional infos, fwiw:

Not sure these helkp with the question, but for completeness sake.

  • The installer GUI clearly indicates what is going on: (sorry, german Windows)

"No action was taken because a reboot of the system is required."

  • This is an InnoSetup built installer for our "product suite", that will be used by customers, the installation order goes as follows:

    1. Run MSVC 2005 (VC8) 32 bit vcredist
    2. Run MSVC 2010 (VC10) 32 bit vcredist
    3. Run MSVC 2017 (VC141) 64 bit vcredist
    4. Run MSVC 2017 (VC141) 32 bit vcredist
    5. Run a few other third party dependecy / library installers
    6. Install the actual application files (via InnoSetup)
    7. Reboot (ask) if any installer indicated a required reboot.

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.

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.

解决方案

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆