raja_89
raja_89

Reputation: 3

Unable to Uninstall WiX Managed Bootstrapper application from another Managed Bootstrapper Application

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

<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">

        <Variable Name="KambanVersion" Type="version" Value="!(bind.packageVersion.KambanFASSetup)"/>

        <BootstrapperApplicationRef Id="ManagedBootstrapperApplicationHost">
          <PayloadGroupRef Id="InstallerPayload"/>
        </BootstrapperApplicationRef>

        <util:RegistrySearchRef Id='SearchForKamban' />

        <Chain>
          <PackageGroupRef Id="InstallerPackages"/>
        </Chain>

        <Variable Name="DbName" bal:Overridable="yes" />
        <Variable Name="SqlInstance" bal:Overridable="yes" />
        <Variable Name="InstallPath" bal:Overridable="yes" />
        <Variable Name="Roles" bal:Overridable="yes" />
        <Variable Name="Modules" bal:Overridable="yes" />
        <Variable Name="CustomInstall" bal:Overridable="yes"/>

        <WixVariable Id="WixMbaPrereqPackageId" Value="Netfx4Full" />
        <WixVariable Id="WixMbaPrereqLicenseUrl" Value="NetfxLicense.rtf" />

      </Bundle>

      <Fragment>
        <PayloadGroup Id="InstallerPayload">
          <Payload SourceFile="..\Nestle.MES.Bootstrapper.UI\BootstrapperCore.config"/>
          <Payload SourceFile="..\Nestle.MES.Bootstrapper.UI\bin\$(var.Configuration)\Nestle.MES.Bootstrapper.UI.dll"/>
          <Payload SourceFile="C:\Program Files (x86)\WiX Toolset v3.10\SDK\Microsoft.Deployment.WindowsInstaller.dll"/>
        </PayloadGroup>
      </Fragment>

      <Fragment>
        <PackageGroup Id="InstallerPackages">
          <RollbackBoundary Id="StartingPoint" Vital="yes" />
          <ExePackage Id="KambanFASSetup" Cache="no" Compressed="yes" Vital="yes" Permanent="no" Name="KambanCoreSetup"
                      SourceFile="..\..\Kamban.FAS.Setup_Source\$(var.Configuration)\KambanFASSetup.exe" >
            <CommandLine InstallArgument="[SqlInstance]" Condition="1" />
            <CommandLine InstallArgument="[DbName]" Condition="1"/>
            <CommandLine InstallArgument="[InstallPath]" Condition="1"/>
            <CommandLine InstallArgument="[Roles]" Condition="1"/>
            <CommandLine InstallArgument="[Modules]" Condition="1" />
            <CommandLine InstallArgument="[CustomInstall]" Condition="1"/>
          </ExePackage>

          <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">
            <MsiProperty Name="INSTALLFOLDER" Value="[INSTALLFOLDER]"  />
            <MsiProperty Name="VERSION" Value="[VERSION]"/>
            <MsiProperty Name="ADDLOCAL" Value="[NestleFeatures]" />
          </MsiPackage>
        </PackageGroup>
      </Fragment>

      <Fragment>
        <util:RegistrySearch
          Id='SearchForKamban'
          Variable="KambanInstalled"
          Result="exists"
          Root="HKLM"
          Key="SOFTWARE\Wow6432Node\KambanFAS" />
        <bal:Condition Message="Product already Exists">
          KambanInstalled
        </bal:Condition>
      </Fragment>

In the above code, you can see that I have an MsiPackage and an ExePackage in my Bundle chain. The ExePackage with Id="KambanFASSetup" 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 NestleMESSetup only my MsiPackage is getting uninstaled and my ExePackage doesnt. But my requirement is as follows

Please let me know if more info is needed.Any help on this would be much appreciated.

Edit1: Here is the Uninstall logs in %temp% folder

[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

Edit2: 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

[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

Upvotes: 0

Views: 1042

Answers (1)

dvorn
dvorn

Reputation: 3147

Your ExePackage is missing the UninstallCommand attribute so burn does not know how to properly uninstall it. It should be something like

UninstallCommand="/uninstall /quiet"

and may be some additions if needed.

And for burn to be able to detect the ExePackage, it should define the attribute DetectCondition. Something like

DetectCondition="KambanInstalled"

Upvotes: 3

Related Questions