WIX v3.9 Burn custom BA 卸载相关包最后而不是最先
WIX v3.9 Burn custom BA uninstalls related bundles last instead of first
我们最近为我们的安装程序切换到了自定义引导程序。这允许用户从可能的模块列表中 select 安装(每个作为单独的 msi)。我们现在正在进行第一次升级,并且 运行 成为一个问题。 Burn 正确升级了 msi,但它没有正确处理 ARP 中列出的引导程序。它最后尝试卸载引导程序但随后失败,因为已经安装了更高版本的引导程序。
根据这篇文章https://support.firegiant.com/entries/24024208-Bundle-chain-execution-order-升级的执行顺序应该首先卸载相关的包:
"When planning an uninstall, the Burn engine plans all related bundles first. Thus related bundles are always removed before the chained packages are removed.
但是,这不是我们看到的行为。最后卸载相关包:
[11C4:0868][2015-02-26T10:09:26]i102: Detected related bundle: {9e3abad2-c78b-48ec-a523-c5c4de4fe3f1}, type: Upgrade, scope: PerMachine, version: 7.5.0.0, operation: MajorUpgrade
...
[11C4:0868][2015-02-26T10:09:38]i207: Planned related bundle: {9e3abad2-c78b-48ec-a523-c5c4de4fe3f1}, type: Upgrade, default requested: Absent, ba requested: Absent, execute: Uninstall, rollback: Install, dependency: None
[11C4:0868][2015-02-26T10:09:38]i299: Plan complete, result: 0x0
...
[1224:0E20][2015-02-26T10:23:26]i301: Applying execute package: {9e3abad2-c78b-48ec-a523-c5c4de4fe3f1}, action: Uninstall, path: C:\ProgramData\Package Cache\{9e3abad2-c78b-48ec-a523-c5c4de4fe3f1}\FlexSimInstaller.exe, arguments: '"C:\ProgramData\Package Cache\{9e3abad2-c78b-48ec-a523-c5c4de4fe3f1}\FlexSimInstaller.exe" -uninstall -quiet -burn.related.upgrade -burn.ancestors={36ff969e-da98-4c27-9dde-20e090c0812f}'
[11C4:0868][2015-02-26T10:23:35]i319: Applied execute package: {9e3abad2-c78b-48ec-a523-c5c4de4fe3f1}, result: 0x0, restart: None
[11C4:0868][2015-02-26T10:23:35]i399: Apply complete, result: 0x0, restart: None, ba requested restart: No
[11C4:0868][2015-02-26T10:23:38]i500: Shutting down, exit code: 0x0
我们知道无法更改顺序,那么如何让升级生效?
当您安装升级包时,您是在安装它,而不是在卸载它。所以顺序是 FireGiant 文章为安装指定的:安装升级的包(通常升级它包含的包)并卸载相关的包(旧包)。当旧的 bundle 被卸载时,它知道它的包已经升级,所以它不理会它们,只删除它自己的注册。
如果您的 BA 试图阻止降级,它也需要考虑该操作。例如,WixStdBA 让卸载发生如下:
if (m_fDowngrading && BOOTSTRAPPER_ACTION_UNINSTALL < action)
我们最近为我们的安装程序切换到了自定义引导程序。这允许用户从可能的模块列表中 select 安装(每个作为单独的 msi)。我们现在正在进行第一次升级,并且 运行 成为一个问题。 Burn 正确升级了 msi,但它没有正确处理 ARP 中列出的引导程序。它最后尝试卸载引导程序但随后失败,因为已经安装了更高版本的引导程序。
根据这篇文章https://support.firegiant.com/entries/24024208-Bundle-chain-execution-order-升级的执行顺序应该首先卸载相关的包:
"When planning an uninstall, the Burn engine plans all related bundles first. Thus related bundles are always removed before the chained packages are removed.
但是,这不是我们看到的行为。最后卸载相关包:
[11C4:0868][2015-02-26T10:09:26]i102: Detected related bundle: {9e3abad2-c78b-48ec-a523-c5c4de4fe3f1}, type: Upgrade, scope: PerMachine, version: 7.5.0.0, operation: MajorUpgrade
...
[11C4:0868][2015-02-26T10:09:38]i207: Planned related bundle: {9e3abad2-c78b-48ec-a523-c5c4de4fe3f1}, type: Upgrade, default requested: Absent, ba requested: Absent, execute: Uninstall, rollback: Install, dependency: None
[11C4:0868][2015-02-26T10:09:38]i299: Plan complete, result: 0x0
...
[1224:0E20][2015-02-26T10:23:26]i301: Applying execute package: {9e3abad2-c78b-48ec-a523-c5c4de4fe3f1}, action: Uninstall, path: C:\ProgramData\Package Cache\{9e3abad2-c78b-48ec-a523-c5c4de4fe3f1}\FlexSimInstaller.exe, arguments: '"C:\ProgramData\Package Cache\{9e3abad2-c78b-48ec-a523-c5c4de4fe3f1}\FlexSimInstaller.exe" -uninstall -quiet -burn.related.upgrade -burn.ancestors={36ff969e-da98-4c27-9dde-20e090c0812f}'
[11C4:0868][2015-02-26T10:23:35]i319: Applied execute package: {9e3abad2-c78b-48ec-a523-c5c4de4fe3f1}, result: 0x0, restart: None
[11C4:0868][2015-02-26T10:23:35]i399: Apply complete, result: 0x0, restart: None, ba requested restart: No
[11C4:0868][2015-02-26T10:23:38]i500: Shutting down, exit code: 0x0
我们知道无法更改顺序,那么如何让升级生效?
当您安装升级包时,您是在安装它,而不是在卸载它。所以顺序是 FireGiant 文章为安装指定的:安装升级的包(通常升级它包含的包)并卸载相关的包(旧包)。当旧的 bundle 被卸载时,它知道它的包已经升级,所以它不理会它们,只删除它自己的注册。
如果您的 BA 试图阻止降级,它也需要考虑该操作。例如,WixStdBA 让卸载发生如下:
if (m_fDowngrading && BOOTSTRAPPER_ACTION_UNINSTALL < action)