Run*_*nt8 19 wix burn vcredist visual-studio-2015
我有一个使用Visual Studio 2015开发的c ++应用程序,以及一个Wix安装程序和一个Burn bootstrapper.该应用程序的早期版本能够使用Visual Studio合并模块来安装必要的先决条件,但在使用Visual Studio 2015时看起来这不是一个选项(请参阅Redistributables用于部署在Windows 7上使用Visual Studio 2015开发的C++ exe)).
根据该链接中的建议,我们已经开始使用带有vital ="yes"的ExePackage在Burn中安装vcredist.这通常很有效 - 我们有几个客户由于vcredist的各种问题导致安装失败.直到最近,这些都是导致安装失败的错误.
在过去的几天里,由于安装了较新版本的可再发行组件,我们收到了几个安装程序失败的报告:vcredist失败,错误代码为0x80070666,导致我们的引导程序失败.
我的问题是:
bra*_*drg 30
部署vcredist是一种合适的方法.
您可以使用FileSearch Element(Util Extension)搜索其中一个vcredist文件并检索其版本.然而,该方法是由事实复杂内置变量烧伤SystemFolder和System64Folder反转相对于在Windows Installer中类似的变量.搜索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"/>
Run Code Online (Sandbox Code Playgroud)
变量vc14x64Exists和vc14x64Version随后被用在DetectCondition制定是否安装VCl 4的64位版本:
DetectCondition="vc14x64Exists AND vc14x64Version >= v14.0.nnnnn"
Run Code Online (Sandbox Code Playgroud)
类似地DetectCondition,32位版本的VC14是:
DetectCondition="vc14x86Exists AND vc14x86Version >= v14.0.nnnnn"
Run Code Online (Sandbox Code Playgroud)
注意:在这两种情况下,您都需要nnnnn使用安装程序中包含的vcredist的内部版本号替换.
编辑1:作为替代方案,您可以使用此处概述的升级代码搜索来检测VC Redist的存在.
编辑2:在我创作的安装程序中,我通常不会尝试检测VC Redist的存在.相反,我让VC Redist安装程序运行,让自己弄清楚是安装,升级还是什么都不做.
到目前为止,我发现了三个版本的VC14 redist文件:
a)14.0.23026 - 可从此处的 Microsoft链接下载.
b)14.0.23506 - 随Visual Studio 2015 Update 1提供.
c)14.0.23918 - 随Visual Studio 2015 Update 2提供.
虽然较新版本的vcredist已随Visual Studio更新发布,但Microsoft尚未更新可从其网站下载的版本.
您可以告诉刻录忽略已安装的错误代码0x80070666使用<ExitCode Value="1638" Behavior="success"/>.注意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>
Run Code Online (Sandbox Code Playgroud)我最近遇到了类似的问题,我正在处理的产品安装程序因错误0x80070666而暂停.问题是已经安装了更新版本的vcredist.我最终使用的解决方案是:a)包括最新版本的vcredist(14.0.23918),以及b)添加<ExitCode Value="1638" Behavior="success"/>指令告诉刻录如果已经安装了未来较新版本的vcredist,则不会抛出错误.
| 归档时间: |
|
| 查看次数: |
7449 次 |
| 最近记录: |