Csaba Fabian
Csaba Fabian

Reputation: 876

Uninstalling bundle does not remove exe package

I have a the following 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>

All the prerequisites are machine-wide, the main installer is per user (it's a squirrel.windows installer).

The name of the ExePackage element is identical to the name of the installer.

When I uninstall the bundle, the main installer does not get invoked.

I also tried adding a custom action to the end of the chain in order to explicitly uninstall the application. The technique is described here: https://stackoverflow.com/a/34111659/1151959

The custom action doesn't get called on uninstall either:

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

I get the install.txt but not the uninstall.txt.

See the uninstall log below (with sensitive data replaced):

[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 Cache\1608BB75347CD8C40187E5F3C0A969ED73A98D51\
[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

Any help is greatly appreciated!

Upvotes: 1

Views: 1528

Answers (1)

TeaHoney
TeaHoney

Reputation: 150

For an exe to uninstall the installer must detect it, unlike MSI's there is no automatic detection for exe files.

In your case the state of the exe package is:

"Planned package: custom_action.cmd, state: Absent, " (when it should be: "Planned package: custom_action.cmd, state: Present, ').

I think implementing a 'DetectCondition' for the ExePackage should solve the issue (just be sure the implement it correctly because the detect condition is also evaluated on install...)

Upvotes: 1

Related Questions