title: Unable to Uninstall WiX Managed Bootstrapper application from another Managed Bootstrapper Application
body: <p>I have my own Managed Bootstrapper Application developed using WiX Toolset and written in c# using MVVM pattern. As this is a Managed Bootstrapper Application, i have a custom UI as well. My Bundle.wxs Code is as follows</p>
  
  <pre><code>&lt;Bundle Name="NestleMESSetup"
            Version="!(bind.packageVersion.NestleCustomLayerSetupPackage)"
            Manufacturer="CT Infotech"
                UpgradeCode="CCBB8D5B-8171-47FB-AD53-25C6E866C34E"
                Copyright="Copyright© 2017 CT Infotech ALL RIGHTS RESERVED"
                SplashScreenSourceFile="Resources\Splash.bmp"
                IconSourceFile="Resources\menu.ico"&gt;
  
          &lt;Variable Name="KambanVersion" Type="version" Value="!(bind.packageVersion.KambanFASSetup)"/&gt;
  
          &lt;BootstrapperApplicationRef Id="ManagedBootstrapperApplicationHost"&gt;
            &lt;PayloadGroupRef Id="InstallerPayload"/&gt;
          &lt;/BootstrapperApplicationRef&gt;
  
          &lt;util:RegistrySearchRef Id='SearchForKamban' /&gt;
  
          &lt;Chain&gt;
            &lt;PackageGroupRef Id="InstallerPackages"/&gt;
          &lt;/Chain&gt;
  
          &lt;Variable Name="DbName" bal:Overridable="yes" /&gt;
          &lt;Variable Name="SqlInstance" bal:Overridable="yes" /&gt;
          &lt;Variable Name="InstallPath" bal:Overridable="yes" /&gt;
          &lt;Variable Name="Roles" bal:Overridable="yes" /&gt;
          &lt;Variable Name="Modules" bal:Overridable="yes" /&gt;
          &lt;Variable Name="CustomInstall" bal:Overridable="yes"/&gt;
  
          &lt;WixVariable Id="WixMbaPrereqPackageId" Value="Netfx4Full" /&gt;
          &lt;WixVariable Id="WixMbaPrereqLicenseUrl" Value="NetfxLicense.rtf" /&gt;
  
        &lt;/Bundle&gt;
  
        &lt;Fragment&gt;
          &lt;PayloadGroup Id="InstallerPayload"&gt;
            &lt;Payload SourceFile="..\Nestle.MES.Bootstrapper.UI\BootstrapperCore.config"/&gt;
            &lt;Payload SourceFile="..\Nestle.MES.Bootstrapper.UI\bin\$(var.Configuration)\Nestle.MES.Bootstrapper.UI.dll"/&gt;
            &lt;Payload SourceFile="C:\Program Files (x86)\WiX Toolset v3.10\SDK\Microsoft.Deployment.WindowsInstaller.dll"/&gt;
          &lt;/PayloadGroup&gt;
        &lt;/Fragment&gt;
  
        &lt;Fragment&gt;
          &lt;PackageGroup Id="InstallerPackages"&gt;
            &lt;RollbackBoundary Id="StartingPoint" Vital="yes" /&gt;
            &lt;ExePackage Id="KambanFASSetup" Cache="no" Compressed="yes" Vital="yes" Permanent="no" Name="KambanCoreSetup"
                        SourceFile="..\..\Kamban.FAS.Setup_Source\$(var.Configuration)\KambanFASSetup.exe" &gt;
              &lt;CommandLine InstallArgument="[SqlInstance]" Condition="1" /&gt;
              &lt;CommandLine InstallArgument="[DbName]" Condition="1"/&gt;
              &lt;CommandLine InstallArgument="[InstallPath]" Condition="1"/&gt;
              &lt;CommandLine InstallArgument="[Roles]" Condition="1"/&gt;
              &lt;CommandLine InstallArgument="[Modules]" Condition="1" /&gt;
              &lt;CommandLine InstallArgument="[CustomInstall]" Condition="1"/&gt;
            &lt;/ExePackage&gt;
  
            &lt;MsiPackage SourceFile="..\..\build_folder\$(var.Configuration)\Nestle.MES.CustomLayer\Nestle.MES.CustomLayerSetup.msi"
                        Id="NestleCustomLayerSetupPackage" Cache="yes" Visible="no" Compressed="yes" EnableFeatureSelection="yes" Vital="yes"&gt;
              &lt;MsiProperty Name="INSTALLFOLDER" Value="[INSTALLFOLDER]"  /&gt;
              &lt;MsiProperty Name="VERSION" Value="[VERSION]"/&gt;
              &lt;MsiProperty Name="ADDLOCAL" Value="[NestleFeatures]" /&gt;
            &lt;/MsiPackage&gt;
          &lt;/PackageGroup&gt;
        &lt;/Fragment&gt;
  
        &lt;Fragment&gt;
          &lt;util:RegistrySearch
            Id='SearchForKamban'
            Variable="KambanInstalled"
            Result="exists"
            Root="HKLM"
            Key="SOFTWARE\Wow6432Node\KambanFAS" /&gt;
          &lt;bal:Condition Message="Product already Exists"&gt;
            KambanInstalled
          &lt;/bal:Condition&gt;
        &lt;/Fragment&gt;
  </code></pre>
  
  <p>In the above code, you can see that I have an MsiPackage and an ExePackage in my Bundle chain. The ExePackage with <strong>Id="KambanFASSetup"</strong> is also a Managed Bootstrapper Application with its very own custom UI. Once I install this Parent bundle exe, i get two entries in my Programs and Features. I believe this is because i have two managed bootstrapper exe. So now while uninstalling the <strong>NestleMESSetup</strong> only my MsiPackage is getting uninstaled and my ExePackage doesnt.  But my requirement is as follows</p>
  
  <ul>
  <li>The ExePackage should also be uninstalled if I uninstall the Parent Exe.</li>
  <li>The Uninstallation of the Child ExePackage must happen silently. i.e
  It's UI should <strong>NOT</strong> be shown prompting the user to click the Uninstall
  button again.</li>
  </ul>
  
  <p>Please let me know if more info is needed.Any help on this would be much appreciated.</p>
  
  <p><strong>Edit1:</strong>
  Here is the Uninstall logs in %temp% folder</p>
  
  <pre><code>[2658:3330][2017-05-19T19:27:11]i001: Burn v3.10.2.2516, Windows v6.1 (Build 7601: Service Pack 1), path: C:\ProgramData\Package Cache\{a21ebf3e-08b2-4b64-b5bf-38dccfea21a2}\Nestle.MES.Setup.exe
  [2658:3330][2017-05-19T19:27:11]i000: Initializing version variable 'KambanVersion' to value '1.0.647.0'
  [2658:3330][2017-05-19T19:27:11]i009: Command Line: '/uninstall'
  [2658:3330][2017-05-19T19:27:11]i000: Setting string variable 'WixBundleLog' to value 'C:\Users\RAJASA~1.000\AppData\Local\Temp\NestleMESSetup_20170519192711.log'
  [2658:3330][2017-05-19T19:27:11]i000: Setting string variable 'WixBundleManufacturer' to value 'CT Infotech'
  [2658:3330][2017-05-19T19:27:11]i000: Loading managed bootstrapper application.
  [2658:3330][2017-05-19T19:27:11]i000: Creating BA thread to run asynchronously.
  [2658:3330][2017-05-19T19:27:11]i100: Detect begin, 2 packages
  [2658:3330][2017-05-19T19:27:11]i000: Setting numeric variable 'KambanInstalled' to value 1
  [2658:3330][2017-05-19T19:27:11]i101: Detected package: KambanFASSetup, state: Absent, cached: None
  [2658:3330][2017-05-19T19:27:11]i101: Detected package: NestleCustomLayerSetupPackage, state: Present, cached: Complete
  [2658:3330][2017-05-19T19:27:11]i104: Detected package: NestleCustomLayerSetupPackage, feature: AppFeatures, state: Local
  [2658:3330][2017-05-19T19:27:11]i104: Detected package: NestleCustomLayerSetupPackage, feature: WebFeatures, state: Local
  [2658:3330][2017-05-19T19:27:11]i104: Detected package: NestleCustomLayerSetupPackage, feature: DbFeatures, state: Local
  </code></pre>
  
  <p><strong>Edit2:</strong>
  With the Detect Condition added to my Bundle chain Exe package I am not able to Uninstall the Parent exe as well. The WiX logs are as follows</p>
  
  <pre><code>[1450:1BBC][2017-05-20T07:33:59]i371: Updating session, registration key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{c8fb8ef8-905f-4bd9-8675-91f62d83e5c8}, resume: Active, restart initiated: No, disable resume: No
  [1644:0F04][2017-05-20T07:33:59]w341: Prompt for source of container: WixAttachedContainer, path: E:\TFS_Nestle\Nestle\build_folder\Debug\Nestle.MES.Setup\Nestle.MES.Setup.exe
  [1644:0F04][2017-05-20T07:33:59]e054: Failed to resolve source for file: E:\TFS_Nestle\Nestle\build_folder\Debug\Nestle.MES.Setup\Nestle.MES.Setup.exe, error: 0x80070002.
  [1644:0F04][2017-05-20T07:33:59]e000: Error 0x80070002: Failed while prompting for source (original path 'E:\TFS_Nestle\Nestle\build_folder\Debug\Nestle.MES.Setup\Nestle.MES.Setup.exe').    [1644:0F04][2017-05-20T07:33:59]e311: Failed to acquire container: WixAttachedContainer to working path: C:\Users\RAJASA~1.000\AppData\Local\Temp\{B5BE6652-F453-40B5-A2BF-6313B191EA7F}\9FD1B9E707102B3EB2E75EA87962C5C839E9588A, error: 0x80070002.
  [1644:1B24][2017-05-20T07:33:59]e000: Error 0x80070002: Failed while caching, aborting execution.
  [1450:1BBC][2017-05-20T07:33:59]i372: Session end, registration key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{c8fb8ef8-905f-4bd9-8675-91f62d83e5c8}, resume: ARP, restart: None, disable resume: No
  [1450:1BBC][2017-05-20T07:33:59]i371: Updating session, registration key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{c8fb8ef8-905f-4bd9-8675-91f62d83e5c8}, resume: ARP, restart initiated: No, disable resume: No
  [1644:1B24][2017-05-20T07:33:59]i399: Apply complete, result: 0x80070002, restart: None, ba requested restart:  No
  [1644:1B24][2017-05-20T07:33:59]i500: Shutting down, exit code: 0x0
  </code></pre>