【问题标题】:Wix Patch Bundle ServicingWix 补丁包服务
【发布时间】:2013-10-31 14:09:51
【问题描述】:

以下是两个非常基本的烧录引导程序的源代码。 Bootstrapper 安装 2 个 MSI 包,然后 SP1 对 appdata MSI 包执行重大升级。最初这工作得很好,只是我有几个维修探针。

  1. 当我移除父引导程序时,它足够聪明地移除子 SP1 补丁。但是,当我从添加/删除程序中删除 SP1 更新时,根本没有安装任何 appdata。我必须对原始 Bootstrapper 包进行修复才能重新安装原始版本的 appdata。这是一个错误还是我执行错了?

  2. 我可以自行安装 SP1 包。如果尚未安装 Bootstrapper,如何防止安装 SP1?

  3. 如果我创建了 Bootstrapper 2.0,它将正确取代 Bootstrapper 1.0 和 SP1。如果我运行 Bootstrapper 1.0,它会正确阻塞。但如果我运行 SP1,它会安装。如何仅将 SP1 限制为 Bootsrapper v1?

  4. 如果目前无法实现前两项,是否可以创建不可移除的 SP1? (强制删除和重新安装父捆绑包以恢复原始状态。)我看到了如何使用 DisableRemove 和 DisableModify 属性,但它根本没有出现在添加/删除程序中,用户仍然可以返回EXE 并使用 WiXStdBA 删除包。

    <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
        <Bundle Manufacturer="ISWIX" Name="Bootstrapper" UpgradeCode="44a1059e-e7f7-46c7-9627-b720d6417d69" Version="1.0.0.0">
            <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense"/>
            <Chain>
                <MsiPackage SourceFile="app-1.0.msi"/>
                <MsiPackage SourceFile="appdata-1.0.msi"/>
            </Chain>
        </Bundle>
    </Wix>
    
    <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
        <Bundle Manufacturer="ISWIX" Name="SP1" ParentName="Bootstrapper" UpgradeCode="44a1059e-e7f7-46c7-9627-b720d6417d69" Version="1.0.0.1">
            <RelatedBundle Action="Patch" Id="44a1059e-e7f7-46c7-9627-b720d6417d69"/>
            <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense"/>
            <Chain>
                <MsiPackage SourceFile="appdata-1.1.msi"/>
            </Chain>
        </Bundle>
    </Wix>
    

【问题讨论】:

  • 对不起,我发布了 XML,但它不会呈现。这是我能想出的最好的分享。
  • 为什么不使用代码示例 {} 来粘贴实际的 XML。
  • 我试了一遍又一遍。当我只粘贴 XML 时,它不会全部显示出来。当我把它放在引号块或代码块中时,它变得很奇怪。
  • @ChristopherPainter:关于格式,请参阅meta.stackexchange.com/questions/3327/… - 在您的情况下,我会使用 add-a-comment,因为代码块在语义上不是列表的一部分。跨度>

标签: wix burn wix3.8


【解决方案1】:

要在没有原始引导程序的情况下停止安装 SP1,您可以使用以下选项之一:

选项 1:利用 bundle/@Condition 属性

<Bundle
    Name="Test123" Version="1.0.0.0"
    Manufacturer="abc cORP" UpgradeCode=""
    Condition="((VersionNT = v6.0)">
</Bundle>

这仅适用于预构建的 wix 刻录变量。变量的详细列表可以在这里找到:LINK

选项 2:第二种方法使用WIXBALExtension Condition 元素:

<bal:Condition
   Message="The Bootstrapper has to be installed in version $(var.BaselineVersion)">  
      WixBundleInstalled OR      
      ((SampleMsiInstalledState = 5) AND (SampleMsiInstalledVersion &gt;= v$(var.BaselineVersion)))
</bal:Condition>
<util:ProductSearch Guid="[msi_prerequisite_package_product_code]"
    Result="version" Variable="SampleMsiInstalledVersion" />
<util:ProductSearch Guid="[msi_prerequisite_package_product_code]"
    Result="state" Variable="SampleMsiInstalledState" />

这里我们使用来自 WixUtilExtension 的 ProductSearch 来查找相关 msi 包的状态和版本。然后将该版本与捆绑包所需的捆绑包的最低版本 (BasellineVersion) 进行比较。

Related Link 1 Related Link 2

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-04-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多