Wix Burn vcredist [英] Wix Burn vcredist

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

问题描述

我有一个使用Visual Studio 2015开发的c ++应用程序,以及一个Wix安装程序和一个Burn Bootstrapper.该应用程序的早期版本能够使用Visual Studio合并模块安装必要的先决条件,但是在使用Visual Studio 2015时,这似乎不是一个选择(请参阅在Windows 7上部署使用Visual Studio 2015开发的C ++ exe的可分发资源).

根据该链接中的建议,我们已开始使用带有vital ="yes"的ExePackage在Burn上安装vcredist.这在大多数情况下都非常有效-我们有几个客户由于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文件之一并获取其版本.但是,由于Windows Installer中类似的变量,内置变量SystemFolderSystem64Folder的内置烧录被颠倒了,因此这种方法变得很复杂.搜索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"/>
    

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

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

    类似地,对于32位版本的VC14,DetectCondition是:

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

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

    或者,您可以使用此处<下载/a>.

    b)14.0.23506- Visual Studio 2015 Update 1 提供.

    c)14.0.23918- Visual Studio 2015 Update 2 提供.

    尽管已随Visual Studio更新发布了vcredist的较新版本,但Microsoft尚未更新可从其网站下载的版本.

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

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

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

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="Redist\vcredist14_x86.exe"
         SourceFile="$(var.RedistPath)\VC14\vcredist_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 vcredist的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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