卸载捆绑包不会删除 exe 包

Uninstalling bundle does not remove exe package

我有以下bundle.wxs.

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"
     xmlns:bal="http://schemas.microsoft.com/wix/BalExtension"
     xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">

  <Bundle Name="<%= @product_name %>"
          Version="<%= @short_version %>"
          Copyright="<%= @copyright %>"
          UpgradeCode="..."
          DisableModify="yes"
          DisableRemove="no"
          IconSourceFile="<%= @icon_path %>"
          Manufacturer="<%= @vendor %>">
      <Chain>
        <!-- Prerequisites as ExePackage or MsuPackage 
        ...
        -->

        <ExePackage DisplayName="<%= @product_name %>"
                    Name="<%= @product_name_short %>"
                    Cache="no"
                    PerMachine="no"
                    SourceFile="Releases/Setup.exe"
                    Permanent="no"
                    Compressed="yes"
                    Vital="yes">
          <ExitCode Value="1638" Behavior="success"/>
        </ExePackage>
      </Chain>
  </Bundle>
</Wix>

所有先决条件都是机器范围的,主要安装程序是每个用户(它是一个 squirrel.windows 安装程序)。

ExePackage 元素的名称与安装程序的名称相同。

当我卸载捆绑包时,没有调用主安装程序。

我还尝试将自定义操作添加到链的末尾,以便明确卸载应用程序。 该技术在此处描述:

卸载时也不会调用自定义操作:

  <ExePackage SourceFile=".\custom-action.cmd"
              InstallCommand="echo test >c:\temp\install.txt"
              UninstallCommand="echo test >c:\temp\uninstall.txt" />

我得到了 install.txt 但没有得到 uninstall.txt。

查看下面的卸载日志(已替换敏感数据):

[0450:1944][2017-10-06T11:54:50]i001: Burn v3.11.0.1701, Windows v10.0 (Build 15063: Service Pack 0), path: C:\Users\<user>\AppData\Local\Temp\{D9345F60-E59E-4038-9E58-C173AD02AAA3}\.cr\<bundle>.exe
[0450:1944][2017-10-06T11:54:50]i009: Command Line: '-burn.clean.room=C:\Temp\<bundle>.exe -burn.filehandle.attached=540 -burn.filehandle.self=560'
[0450:1944][2017-10-06T11:54:50]i000: Setting string variable 'WixBundleOriginalSource' to value 'C:\Temp\<bundle>.exe'
[0450:1944][2017-10-06T11:54:50]i000: Setting string variable 'WixBundleOriginalSourceFolder' to value 'C:\Temp\'
[0450:1944][2017-10-06T11:54:50]i000: Setting string variable 'WixBundleLog' to value 'C:\Users\<user>\AppData\Local\Temp\<product-name>_20171006115450.log'
[0450:1944][2017-10-06T11:54:50]i000: Setting string variable 'WixBundleManufacturer' to value '<company>'
[0450:145C][2017-10-06T11:54:50]i000: Setting numeric variable 'WixStdBALanguageId' to value 1033
[0450:145C][2017-10-06T11:54:50]i000: Setting version variable 'WixBundleFileVersion' to value '7.0.0.0'
[0450:1944][2017-10-06T11:54:50]i100: Detect begin, 17 packages
[0450:1944][2017-10-06T11:54:50]i000: Setting string variable 'NETFRAMEWORK45' to value '460798'
[0450:1944][2017-10-06T11:54:50]i000: Setting string variable 'UNINSTALLSTRING' to value '"C:\Users\<user>\AppData\Local\<product>\Update.exe" --uninstall -s'
[0450:1944][2017-10-06T11:54:50]i052: Condition 'VersionNT64' evaluates to false.
[0450:1944][2017-10-06T11:54:50]i000: Setting string variable 'VCREDISTINSTALLEDX86' to value '14.0.24215'
[0450:1944][2017-10-06T11:54:50]i000: Setting numeric variable 'FoundMfPlatDll' to value 1
[0450:1944][2017-10-06T11:54:50]i000: Setting string variable 'WinRegInstallationType' to value 'Client'
[0450:1944][2017-10-06T11:54:50]i000: Setting string variable 'WinRegReleaseID' to value '1703'
[0450:1944][2017-10-06T11:54:50]i000: Registry key not found. Key = 'SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Packages\Package_for_KB2919355~31bf3856ad364e35~amd64~~6.3.1.14'
[0450:1944][2017-10-06T11:54:50]i000: Registry key not found. Key = 'SOFTWARE\Microsoft\Windows\CurrentVersion\Component Based Servicing\Packages\Package_for_KB2919355~31bf3856ad364e35~x86~~6.3.1.14'
[0450:1944][2017-10-06T11:54:50]i102: Detected related bundle: {<id>}, type: Upgrade, scope: PerUser, version: 7.0.0.0, operation: None
[0450:1944][2017-10-06T11:54:50]i052: Condition 'NETFRAMEWORK45 >= 394802' evaluates to true.
[0450:1944][2017-10-06T11:54:50]i052: Condition 'FoundMfPlatDll' evaluates to true.
[0450:1944][2017-10-06T11:54:50]i052: Condition 'FoundMfPlatDll' evaluates to true.
[0450:1944][2017-10-06T11:54:50]i052: Condition 'FoundMfPlatDll AND WinRegMediaPlayer' evaluates to false.
[0450:1944][2017-10-06T11:54:50]i052: Condition 'FoundMfPlatDll AND WinRegMediaPlayer' evaluates to false.
[0450:1944][2017-10-06T11:54:50]i052: Condition 'FoundMfPlatDll' evaluates to true.
[0450:1944][2017-10-06T11:54:50]i052: Condition 'FoundMfPlatDll' evaluates to true.
[0450:1944][2017-10-06T11:54:50]i052: Condition 'FoundMfPlatDll' evaluates to true.
[0450:1944][2017-10-06T11:54:50]i052: Condition 'FoundMfPlatDll' evaluates to true.
[0450:1944][2017-10-06T11:54:50]i052: Condition 'FoundMfPlatDll' evaluates to true.
[0450:1944][2017-10-06T11:54:50]i052: Condition 'FoundMfPlatDll' evaluates to true.
[0450:1944][2017-10-06T11:54:50]i101: Detected package: NetFx462Web, state: Present, cached: None
[0450:1944][2017-10-06T11:54:50]i101: Detected package: vcredist_x86, state: Absent, cached: None
[0450:1944][2017-10-06T11:54:50]i101: Detected package: vcredist_x64, state: Absent, cached: None
[0450:1944][2017-10-06T11:54:50]i101: Detected package: MediaPackWin7x86, state: Present, cached: None
[0450:1944][2017-10-06T11:54:50]i101: Detected package: MediaPackWin7x64, state: Present, cached: None
[0450:1944][2017-10-06T11:54:50]i101: Detected package: MediaPackWin8x86, state: Absent, cached: None
[0450:1944][2017-10-06T11:54:50]i101: Detected package: MediaPackWin8x64, state: Absent, cached: None
[0450:1944][2017-10-06T11:54:50]i101: Detected package: MediaPackWin81x86, state: Present, cached: None
[0450:1944][2017-10-06T11:54:50]i101: Detected package: MediaPackWin81x64, state: Present, cached: None
[0450:1944][2017-10-06T11:54:50]i101: Detected package: MediaPackWin10x86, state: Present, cached: None
[0450:1944][2017-10-06T11:54:50]i101: Detected package: MediaPackWin10x64, state: Present, cached: None
[0450:1944][2017-10-06T11:54:50]i101: Detected package: MediaPackWin10x861511, state: Present, cached: None
[0450:1944][2017-10-06T11:54:50]i101: Detected package: MediaPackWin10x641511, state: Present, cached: None
[0450:1944][2017-10-06T11:54:50]i101: Detected package: Dokan_x86, state: Present, cached: Complete
[0450:1944][2017-10-06T11:54:50]i101: Detected package: Dokan_x64, state: Absent, cached: None
[0450:1944][2017-10-06T11:54:50]i101: Detected package: <product>, state: Absent, cached: None
[0450:1944][2017-10-06T11:54:50]i101: Detected package: custom_action.cmd, state: Absent, cached: Complete
[0450:1944][2017-10-06T11:54:50]i052: Condition 'VersionNT >= v6.1' evaluates to true.
[0450:1944][2017-10-06T11:54:50]i052: Condition 'NOT ((VersionNT = v6.1) AND ((NOT ServicePackLevel) OR (ServicePackLevel < 1)))' evaluates to true.
[0450:1944][2017-10-06T11:54:50]i052: Condition 'NOT ((VersionNT = v6.3) AND (KB2919355_x86 <> 112 AND KB2919355_amd64 <> 112))' evaluates to true.
[0450:1944][2017-10-06T11:54:50]i199: Detect complete, result: 0x0
[0450:1944][2017-10-06T11:54:51]i200: Plan begin, 17 packages, action: Uninstall
[0450:1944][2017-10-06T11:54:51]w321: Skipping dependency registration on package with no dependency providers: custom_action.cmd
[0450:1944][2017-10-06T11:54:51]w321: Skipping dependency registration on package with no dependency providers: <product>
[0450:1944][2017-10-06T11:54:51]w322: Skipping cross-scope dependency registration on package: Dokan_x64, bundle scope: PerUser, package scope: PerMachine
[0450:1944][2017-10-06T11:54:51]w322: Skipping cross-scope dependency registration on package: Dokan_x86, bundle scope: PerUser, package scope: PerMachine
[0450:1944][2017-10-06T11:54:51]w321: Skipping dependency registration on package with no dependency providers: MediaPackWin10x641511
[0450:1944][2017-10-06T11:54:51]w321: Skipping dependency registration on package with no dependency providers: MediaPackWin10x861511
[0450:1944][2017-10-06T11:54:51]w321: Skipping dependency registration on package with no dependency providers: MediaPackWin10x64
[0450:1944][2017-10-06T11:54:51]w321: Skipping dependency registration on package with no dependency providers: MediaPackWin10x86
[0450:1944][2017-10-06T11:54:51]w321: Skipping dependency registration on package with no dependency providers: MediaPackWin81x64
[0450:1944][2017-10-06T11:54:51]w321: Skipping dependency registration on package with no dependency providers: MediaPackWin81x86
[0450:1944][2017-10-06T11:54:51]w321: Skipping dependency registration on package with no dependency providers: MediaPackWin8x64
[0450:1944][2017-10-06T11:54:51]w321: Skipping dependency registration on package with no dependency providers: MediaPackWin8x86
[0450:1944][2017-10-06T11:54:51]w321: Skipping dependency registration on package with no dependency providers: MediaPackWin7x64
[0450:1944][2017-10-06T11:54:51]w321: Skipping dependency registration on package with no dependency providers: MediaPackWin7x86
[0450:1944][2017-10-06T11:54:51]w321: Skipping dependency registration on package with no dependency providers: vcredist_x64
[0450:1944][2017-10-06T11:54:51]w321: Skipping dependency registration on package with no dependency providers: vcredist_x86
[0450:1944][2017-10-06T11:54:51]w321: Skipping dependency registration on package with no dependency providers: NetFx462Web
[0450:1944][2017-10-06T11:54:51]i207: Planned related bundle: {<id>}, type: Upgrade, default requested: None, ba requested: None, execute: None, rollback: None, dependency: None
[0450:1944][2017-10-06T11:54:51]i201: Planned package: custom_action.cmd, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: Yes, dependency: None
[0450:1944][2017-10-06T11:54:51]i201: Planned package: <product>, state: Absent, default requested: Absent, ba requested: Absent, execute: None, rollback: None, cache: No, uncache: No, dependency: None
[0450:1944][2017-10-06T11:54:51]i201: Planned package: Dokan_x64, state: Absent, default requested: None, ba requested: None, execute: None, rollback: None, cache: No, uncache: No, dependency: None
[0450:1944][2017-10-06T11:54:51]i201: Planned package: Dokan_x86, state: Present, default requested: None, ba requested: None, execute: None, rollback: None, cache: No, uncache: No, dependency: None
[0450:1944][2017-10-06T11:54:51]i201: Planned package: MediaPackWin10x641511, state: Present, default requested: None, ba requested: None, execute: None, rollback: None, cache: No, uncache: No, dependency: None
[0450:1944][2017-10-06T11:54:51]i201: Planned package: MediaPackWin10x861511, state: Present, default requested: None, ba requested: None, execute: None, rollback: None, cache: No, uncache: No, dependency: None
[0450:1944][2017-10-06T11:54:51]i201: Planned package: MediaPackWin10x64, state: Present, default requested: None, ba requested: None, execute: None, rollback: None, cache: No, uncache: No, dependency: None
[0450:1944][2017-10-06T11:54:51]i201: Planned package: MediaPackWin10x86, state: Present, default requested: None, ba requested: None, execute: None, rollback: None, cache: No, uncache: No, dependency: None
[0450:1944][2017-10-06T11:54:51]i201: Planned package: MediaPackWin81x64, state: Present, default requested: None, ba requested: None, execute: None, rollback: None, cache: No, uncache: No, dependency: None
[0450:1944][2017-10-06T11:54:51]i201: Planned package: MediaPackWin81x86, state: Present, default requested: None, ba requested: None, execute: None, rollback: None, cache: No, uncache: No, dependency: None
[0450:1944][2017-10-06T11:54:51]i201: Planned package: MediaPackWin8x64, state: Absent, default requested: None, ba requested: None, execute: None, rollback: None, cache: No, uncache: No, dependency: None
[0450:1944][2017-10-06T11:54:51]i201: Planned package: MediaPackWin8x86, state: Absent, default requested: None, ba requested: None, execute: None, rollback: None, cache: No, uncache: No, dependency: None
[0450:1944][2017-10-06T11:54:51]i201: Planned package: MediaPackWin7x64, state: Present, default requested: None, ba requested: None, execute: None, rollback: None, cache: No, uncache: No, dependency: None
[0450:1944][2017-10-06T11:54:51]i201: Planned package: MediaPackWin7x86, state: Present, default requested: None, ba requested: None, execute: None, rollback: None, cache: No, uncache: No, dependency: None
[0450:1944][2017-10-06T11:54:51]i201: Planned package: vcredist_x64, state: Absent, default requested: None, ba requested: None, execute: None, rollback: None, cache: No, uncache: No, dependency: None
[0450:1944][2017-10-06T11:54:51]i201: Planned package: vcredist_x86, state: Absent, default requested: None, ba requested: None, execute: None, rollback: None, cache: No, uncache: No, dependency: None
[0450:1944][2017-10-06T11:54:51]i201: Planned package: NetFx462Web, state: Present, default requested: None, ba requested: None, execute: None, rollback: None, cache: No, uncache: No, dependency: None
[0450:1944][2017-10-06T11:54:51]i299: Plan complete, result: 0x0
[0450:1944][2017-10-06T11:54:51]i300: Apply begin
[0450:1944][2017-10-06T11:54:52]i371: Updating session, registration key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{<id-2>}, resume: Active, restart initiated: No, disable resume: No
[0450:1944][2017-10-06T11:54:52]i351: Removing cached package: custom_action.cmd, from path: C:\Users\<user>\AppData\Local\Package Cache08BB75347CD8C40187E5F3C0A969ED73A98D51\
[0450:1944][2017-10-06T11:54:52]i372: Session end, registration key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{<id-2>}, resume: None, restart: None, disable resume: No
[0450:1944][2017-10-06T11:54:52]i330: Removed bundle dependency provider: {<id-2>}
[0450:1944][2017-10-06T11:54:52]i352: Removing cached bundle: {<id-2>}, from path: C:\Users\<user>\AppData\Local\Package Cache\{<id-2>}\
[0450:1944][2017-10-06T11:54:52]i371: Updating session, registration key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{<id-2>}, resume: None, restart initiated: No, disable resume: No
[0450:1944][2017-10-06T11:54:52]i399: Apply complete, result: 0x0, restart: None, ba requested restart:  No
[0450:1944][2017-10-06T11:54:56]i500: Shutting down, exit code: 0x0
[0450:1944][2017-10-06T11:54:56]i410: Variable: FoundMfPlatDll = 1
[0450:1944][2017-10-06T11:54:56]i410: Variable: NETFRAMEWORK45 = 460798
[0450:1944][2017-10-06T11:54:56]i410: Variable: SystemFolder = C:\WINDOWS\system32\
[0450:1944][2017-10-06T11:54:56]i410: Variable: UNINSTALLSTRING = "C:\Users\<user>\AppData\Local\<product>\Update.exe" --uninstall -s
[0450:1944][2017-10-06T11:54:56]i410: Variable: VCREDISTINSTALLEDX86 = 14.0.24215
[0450:1944][2017-10-06T11:54:56]i410: Variable: VersionNT = 10.0.0.0
[0450:1944][2017-10-06T11:54:56]i410: Variable: WinRegInstallationType = Client
[0450:1944][2017-10-06T11:54:56]i410: Variable: WinRegReleaseID = 1703
[0450:1944][2017-10-06T11:54:56]i410: Variable: WixBundleAction = 3
[0450:1944][2017-10-06T11:54:56]i410: Variable: WixBundleElevated = 0
[0450:1944][2017-10-06T11:54:56]i410: Variable: WixBundleFileVersion = 7.0.0.0
[0450:1944][2017-10-06T11:54:56]i410: Variable: WixBundleInstalled = 1
[0450:1944][2017-10-06T11:54:56]i410: Variable: WixBundleLog = C:\Users\<user>\AppData\Local\Temp\<product-name>_20171006115450.log
[0450:1944][2017-10-06T11:54:56]i410: Variable: WixBundleManufacturer = <company>
[0450:1944][2017-10-06T11:54:56]i410: Variable: WixBundleName = <product-name>
[0450:1944][2017-10-06T11:54:56]i410: Variable: WixBundleOriginalSource = C:\Temp\<bundle>.exe
[0450:1944][2017-10-06T11:54:56]i410: Variable: WixBundleOriginalSourceFolder = C:\Temp\
[0450:1944][2017-10-06T11:54:56]i410: Variable: WixBundleProviderKey = {<id-2>}
[0450:1944][2017-10-06T11:54:56]i410: Variable: WixBundleSourceProcessFolder = C:\Temp\
[0450:1944][2017-10-06T11:54:56]i410: Variable: WixBundleSourceProcessPath = C:\Temp\<bundle>.exe
[0450:1944][2017-10-06T11:54:56]i410: Variable: WixBundleTag = 
[0450:1944][2017-10-06T11:54:56]i410: Variable: WixBundleUILevel = 4
[0450:1944][2017-10-06T11:54:56]i410: Variable: WixBundleVersion = 7.0.0.0
[0450:1944][2017-10-06T11:54:56]i410: Variable: WixStdBALanguageId = 1033
[0450:1944][2017-10-06T11:54:56]i007: Exit code: 0x0, restarting: No

非常感谢任何帮助!

对于要卸载的 exe,安装程序必须检测到它,与 MSI 不同的是,没有自动检测 exe 文件。

在你的例子中,exe 包的状态是:

"Planned package: custom_action.cmd, state: Absent, "(当它应该是:“计划包:custom_action.cmd,状态:存在,')。

我认为为 ExePackage 实现一个 'DetectCondition' 应该可以解决这个问题(只要确保正确实现它,因为在安装时也会评估检测条件...)