【问题标题】:Wix <MajorUpgrade> not working after bundling the VC redistributables捆绑 VC 可再发行组件后,Wix <MajorUpgrade> 不起作用
【发布时间】:2017-08-07 08:16:36
【问题描述】:

我们最近决定将 VC++ 可再发行包与我们的应用程序捆绑在一起。不幸的是,这破坏了我们的升级。

旧产品未正确卸载,并且仍与新版本一起出现在添加/删除控制面板中。如果我理解正确,当旧安装程序的所有功能没有被卸载时,就会发生这种情况,这就是我尝试下面描述的两种方法的原因。如果我不捆绑 VC 可再发行组件,旧产品将不再显示在控制面板中。

这种行为的原因可能是什么?我该如何解决?

常用代码

<MajorUpgrade
    DowngradeErrorMessage="There is already a version of [ProductName] installed."
    Schedule="afterInstallExecute"
/>

<!-- include the Visual C++ Redistributable -->
<DirectoryRef Id="TARGETDIR">
    <?define MergeModulDir= "C:\Program Files (x86)\Common Files\Merge Modules" ?>
    <Merge Id="VCRedist86" SourceFile="$(var.MergeModulDir)/Microsoft_VC140_CRT_x86.msm"
           DiskId="1" Language="0" />
</DirectoryRef>

版本 1:附加功能

<Feature Id="VCRedist" Title="Visual C++ 14.0 Runtime" AllowAdvertise="no"
         Display="hidden" Level="1">
    <MergeRef Id="VCRedist86" />
</Feature>

<Feature Id="App" Title="Main Application" Level="1">
    <ComponentGroupRef Id="App" />
    <ComponentRef Id="ApplicationShortcut" />
    <ComponentRef Id="CleanRegistry" />
    <ComponentGroupRef Id="SendToShortcuts" />
</Feature>

版本 2:在现有功能中

<Feature Id="App" Title="Main Application" Level="1">
    <ComponentGroupRef Id="App" />
    <ComponentRef Id="ApplicationShortcut" />
    <ComponentRef Id="CleanRegistry" />
    <ComponentGroupRef Id="SendToShortcuts" />
    <MergeRef Id="VCRedist86" />
</Feature>

【问题讨论】:

    标签: windows wix windows-installer


    【解决方案1】:

    我会使用详细日志进行升级以查看发生了什么。特别是查看适用于您的升级的 FindRelatedProduct 事件(会有几个),看看那里是否有任何东西。

    这是我的猜测:一些 C++ 合并模块强制每个系统安装。如果现有安装的产品是每个用户的,那么升级将不会发生,因为它是跨上下文的,留下旧的和已安装的。我不知道当您提到“未卸载旧安装程序的所有功能时”时您看到了什么,但升级是对旧产品的卸载,因此没有理由将其中的一部分抛在后面。更具体地说,查看合并模块的属性表以查看它是否具有 ALLUSERS=1 条目。

    【讨论】:

    • 谢谢,你猜对了。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-08-16
    • 1970-01-01
    • 1970-01-01
    • 2013-12-04
    • 1970-01-01
    • 2013-02-24
    • 1970-01-01
    相关资源
    最近更新 更多