Wix Burn 视频剪辑师 [英] Wix Burn vcredist

查看:18
本文介绍了Wix Burn 视频剪辑师的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个使用 Visual Studio 2015 开发的 C++ 应用程序,以及一个 Wix 安装程序和一个 Burn 引导程序.以前版本的应用程序能够使用 Visual Studio 合并模块来安装必要的先决条件,但在使用 Visual Studio 2015 时这似乎不是一个选项(请参阅 用于在 Windows 7 上部署使用 Visual Studio 2015 开发的 C++ exe 的可再发行组件)...>

按照该链接中的建议,我们已经开始使用带有 Vital="yes" 的 ExePackage 安装 vcredist 和 Burn.这通常效果很好 - 我们有几个客户由于 vcredist 的各种问题而安装失败.直到最近,这些错误都会导致安装失败.

在过去的几天里,我们收到了一些关于我们的安装程序由于安装了新版本的可再发行组件而失败的报告:vcredist 失败,错误代码为 0x80070666,这会导致我们的引导程序失败.

我的问题是:

  1. 部署 vcredist 是正确"的方法吗?(假设我们需要一个 exe 安装程序)
  2. 我们如何知道安装了哪个版本的可再发行组件(不一定在引导程序中,这些信息是否以用户可读的形式存储在某处)?
  3. 是否有我们应该分发的可再发行组件的更新版本?(目前使用 14.0.23026)这是基于用于编译的 Visual Studio 版本还是我们应该始终分发最新版本?(当前 VS 版本 14.0.23107.0)
  4. 作为最后的手段,是否可以检测从 vcredist 返回的错误代码并允许该值确定安装是继续还是失败?

解决方案

  1. 部署 vcredist 是一种合适的方法.

  2. 您可以使用 FileSearch 元素(实用程序扩展) 搜索 vcredist 文件之一并检索其版本.然而,这种方法很复杂,因为内置变量 SystemFolderSystem64Folder 与 Windows Installer 中的类似变量相反.搜索 VC14 的示例:

    <util:FileSearch Id="GetVC14X64Exists" Condition="VersionNT64" Variable="vc14x64Exists" Path="[SystemFolder]vcruntime140.dll" Result="exists"/><util:FileSearch Id="GetVC14X64Version" Condition="VersionNT64" Variable="vc14x64Version" Path="[SystemFolder]vcruntime140.dll" 结果="版本"/><!-- 检测现有版本的 VC ++ 2015 x86 库--><util:FileSearch Id="GetVC14X86onX64Exists" Condition="VersionNT64" Variable="vc14x86Exists" Path="[System64Folder]vcruntime140.dll" 结果="存在"/><util:FileSearch Id="GetVC14X86onX64Version" Condition="VersionNT64" Variable="vc14x86Version" Path="[System64Folder]vcruntime140.dll" 结果="版本"/><util:FileSearch Id="GetVC14X86onX86Exists" Condition="NOT VersionNT64" Variable="vc14x86Exists" Path="[SystemFolder]vcruntime140.dll" Result="exists"/><util:FileSearch Id="GetVC14X86onX86Version" Condition="NOT VersionNT64" Variable="vc14x86Version" Path="[SystemFolder]vcruntime140.dll" Result="version"/>

    变量 vc14x64Existsvc14x64Version 然后可以在 DetectCondition 中使用来确定是否安装了 64 位版本的 VC14:

    DetectCondition="vc14x64Exists AND vc14x64Version &gt;= v14.0.nnnnn"

    同样,VC14 32 位版本的DetectCondition 是:

    DetectCondition="vc14x86Exists AND vc14x86Version &gt;= v14.0.nnnnn"

    注意:在这两种情况下,您都需要将 nnnnn 替换为安装程序中包含的 vcredist 的内部版本号.

    编辑 1: 作为替代方案,您可以使用升级代码搜索来检测 VC Redist 的存在,如此处.

    编辑 2: 在我编写的安装程序中,我通常不会尝试检测 VC Redist 的存在.相反,我让 VC Redist 安装程序运行,让其自行确定是安装、升级还是什么都不做.

  3. 迄今为止,我发现了三个版本的 VC14 redist 文件:

    a) 14.0.23026 - 可从 Microsoft 的链接下载此处.

    b) 14.0.23506 - 随 Visual Studio 2015 更新 1 一起提供.

    c) 14.0.23918 - 随 Visual Studio 2015 更新 2 一起提供.

    虽然较新版本的 vcredist 已随 Visual Studio 更新一起发布,但 Microsoft 尚未更新可从其网站下载的版本.

  4. 您可以使用 <ExitCode Value="1638" Behavior="success"/> 告诉刻录忽略已安装的错误代码 0x80070666.请注意,1638 = 0x666.例如:

    <PackageGroup Id="VC14RedistX86"><执行包缓存=否"压缩=是"PerMachine="是"永久=是"重要=是"名称="Redistvcredist14_x86.exe"SourceFile="$(var.RedistPath)VC14vcredist_23918_x86.exe"InstallCommand="/install/quiet/norestart"><!-- --><ExitCode Value="3010" Behavior="forceReboot"/><!-- 忽略已安装较新版本"错误--><ExitCode Value="1638" Behavior="success"/></ExePackage></PackageGroup>

我最近遇到了类似的问题,我正在处理的产品安装程序因错误 0x80070666 而停止.问题是已经安装了较新版本的 vcredist.我最终使用的解决方案是:a) 包含最新版本的 vcredist (14.0.23918),以及 b) 添加 <ExitCode Value="1638" Behavior="success"/>指示如果已经安装了未来更新版本的 vcredist,则burn 不要抛出错误.

I have a c++ application developed using Visual Studio 2015, along with a Wix installer and a Burn bootstrapper. Previous versions of the application were able to use the Visual Studio merge module to install the necessary prerequisites, but it appears that this isn't an option when using Visual Studio 2015 (see Redistributables for deploying C++ exe developed with Visual Studio 2015 on Windows 7).

Following the advice in that link, we have started installing vcredist with Burn using an ExePackage with vital="yes". This mostly works great - we've had several customers who have the installation fail because of various issues with vcredist. Until recently, these were errors that should cause the installation to fail.

In the past couple of days we've received several reports of our installer failing due to a newer version of the redistributable being installed: vcredist fails with error code 0x80070666, which causes our bootstrapper to fail.

My questions are:

  1. Is deploying vcredist the "correct" approach to take? (Assuming we need to have a single exe installer)
  2. How can we tell what version of the redistributables are installed (not necessarily in the bootstrapper, is this information stored in a user readable form somewhere)?
  3. Is there a newer version of the redistributables that we should be distributing? (Currently using 14.0.23026) Is this based on the version of Visual Studio that is being used to compile or should we always distribute the latest version? (Current VS version 14.0.23107.0)
  4. As a last resort, is it possible to detect the error code returned from vcredist and allow that value to determine if the installation continues or fails?

解决方案

  1. Deploying vcredist is an appropriate approach to take.

  2. You can use the FileSearch Element (Util Extension) to search for one of the vcredist files and retrieve its version. However this approach is complicated by the fact the burn built in variables SystemFolder and System64Folder are reversed with respect the similar variables in Windows Installer. Example of searches for VC14:

    <!-- Detect existing version of VC ++ 2015 x64 libraries -->
    <util:FileSearch Id="GetVC14X64Exists" Condition="VersionNT64" Variable="vc14x64Exists" Path="[SystemFolder]vcruntime140.dll" Result="exists"/>
    <util:FileSearch Id="GetVC14X64Version" Condition="VersionNT64" Variable="vc14x64Version" Path="[SystemFolder]vcruntime140.dll" Result="version"/>
    
    <!-- Detect existing version of VC ++ 2015 x86 libraries -->
    <util:FileSearch Id="GetVC14X86onX64Exists" Condition="VersionNT64" Variable="vc14x86Exists" Path="[System64Folder]vcruntime140.dll" Result="exists"/>
    <util:FileSearch Id="GetVC14X86onX64Version" Condition="VersionNT64" Variable="vc14x86Version" Path="[System64Folder]vcruntime140.dll" Result="version"/>
    <util:FileSearch Id="GetVC14X86onX86Exists" Condition="NOT VersionNT64" Variable="vc14x86Exists" Path="[SystemFolder]vcruntime140.dll" Result="exists"/>
    <util:FileSearch Id="GetVC14X86onX86Version" Condition="NOT VersionNT64" Variable="vc14x86Version" Path="[SystemFolder]vcruntime140.dll" Result="version"/>
    

    The variables vc14x64Exists and vc14x64Version can then be used in a DetectCondition to work out whether the 64 bit version of VC14 is installed:

    DetectCondition="vc14x64Exists AND vc14x64Version &gt;= v14.0.nnnnn"
    

    Similarly the DetectCondition for the 32 bit version of VC14 is:

    DetectCondition="vc14x86Exists AND vc14x86Version &gt;= v14.0.nnnnn"
    

    Note: In both cases you need to substitute nnnnn with the build number of the vcredist you are including in your installer.

    Edit 1: As an alternative you could detect the presence of VC Redist using an upgrade code search as outlined here.

    Edit 2: In the installers that I author I generally don't try to detect the presence of VC Redist. Instead I let the VC Redist installer run and let itself figure out whether to install, upgrade or do nothing.

  3. To date I've found three versions of the VC14 redist files:

    a) 14.0.23026 - Downloadable from Microsoft's link here.

    b) 14.0.23506 - Provided with Visual Studio 2015 Update 1.

    c) 14.0.23918 - provided with Visual Studio 2015 Update 2.

    Although newer versions of vcredist have been released with Visual Studio updates, Microsoft has not updated the version downloadable from their web site.

  4. You can tell burn to ignore the already installed error code 0x80070666 using <ExitCode Value="1638" Behavior="success"/>. Note that 1638 = 0x666. For example:

    <!-- Microsoft Visual C++ 2015 x86 libraries -->
    <PackageGroup Id="VC14RedistX86">
      <ExePackage
         Cache="no"
         Compressed="yes"
         PerMachine="yes"
         Permanent="yes"
         Vital="yes"
         Name="Redistvcredist14_x86.exe"
         SourceFile="$(var.RedistPath)VC14vcredist_23918_x86.exe"
         InstallCommand="/install /quiet /norestart">
    
         <!-- -->
         <ExitCode Value="3010" Behavior="forceReboot"/>
    
         <!-- Ignore "Newer version installed" error -->
         <ExitCode Value="1638" Behavior="success"/>
      </ExePackage>
    </PackageGroup>
    

I ran into a similar problem recently where a product installer I was working on halted with error 0x80070666. The problem was a newer version of vcredist already installed. The solution I ended up using was: a) include the latest version of vcredist (14.0.23918), and b) add the <ExitCode Value="1638" Behavior="success"/> directive to tell burn not to throw an error if a future newer version of vcredist is already installed.

这篇关于Wix Burn 视频剪辑师的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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