Cancel Installation of Wix Burn Boostrapper and Remove ARP Entry

1

I have a Wix Bootstrapper that, for the cases solving this issue, installs a single msi. If the user cancels mid installation, or the installation is unable to complete due to files in use, the bootstrapper starts the rollback process. The partially installed msi is properly cleaned up and files are removed. However, the ARP entry for the wix bootstrapper is still present. There are no other installed msis. Nothing is marked as permanent. It would seem to me that the ARP entry should be removed as nothing was installed. Here's the XML:

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:util="http://schemas.microsoft.com/wix/UtilExtension" xmlns:bal="http://schemas.microsoft.com/wix/BalExtension">
  <?include "$(var.ProjectDir)WixVariables.wxi" ?>
  <Bundle Name="$(var.ProductDescription)" UpgradeCode="$(var.UpgradeCode)" Version="$(var.Version)" 
          Manufacturer="FlexSim Software Products, Inc." AboutUrl="https://www.flexsim.com"
          IconSourceFile="$(var.ProjectDir)..\FlexSimBootstrapper\Resources\flexsim.ico"
          DisableModify="yes" Tag="FlexSim">
    <RelatedBundle Id="$(var.UpgradeCode)" Action="Upgrade"/>
    <!-- <Update Location="https://www.flexsim.com/sw/installers/?version=[Version]" /> -->
    <BootstrapperApplicationRef Id="ManagedBootstrapperApplicationHost">
      <Payload SourceFile="$(var.ProjectDir)..\FlexSimBootstrapper\BootstrapperCore.config"/>
      <Payload SourceFile="$(var.ProjectDir)..\FlexSimBootstrapper\bin\FlexSimBootstrapper.dll"/>
      <Payload SourceFile="$(var.ProjectDir)..\FlexSimBootstrapper\bin\GalaSoft.MvvmLight.dll"/>
      <Payload SourceFile="C:\Program Files (x86)\WiX Toolset v3.11\SDK\Microsoft.Deployment.WindowsInstaller.dll"/>
    </BootstrapperApplicationRef>

    <Variable Name="InstallFolder" bal:Overridable="yes" />

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

    <util:FileSearch Id="UCRTFileSearch" Path="[SystemFolder]ucrtbase.dll" Result="exists" Variable="UCRTInstalled"/>
    <util:RegistrySearch Root="HKLM" Key="SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Full" Value="Version" Variable="Netfx4FullVersion" />
    <util:RegistrySearch Root="HKLM" Key="SOFTWARE\Microsoft\Net Framework Setup\NDP\v4\Full" Value="Version" Variable="Netfx4x64FullVersion" Win64="yes" />

    <util:RegistrySearch Root="HKLM" Key="SOFTWARE\FlexSim\$(var.FullProductName)" Value="InstallDir" Variable="PreviousInstallDirx86" Win64="no" />
    <util:RegistrySearch Root="HKLM" Key="SOFTWARE\FlexSim\$(var.FullProductName)" Value="InstallDir" Variable="PreviousInstallDirx64" Win64="yes" />

    <Chain>
      <!-- 64-bit FlexSim -->      
      <MsiPackage Id="FlexSim_x64"
            Name="flexsim__$(var.Version).$(var.Beta)_x64"
            SourceFile="$(var.ProjectDir)..\Installers\FlexSimMsiInstaller_x64.msi"
            Description="$(var.FullProductName) Installer Setup Program"
            DisplayInternalUI="no"
            Cache="yes"
            Vital="no"
            Compressed="no"
            Visible="no"
            DownloadUrl="https://www.flexsim.com/sw/installers/?i={2}">
        <MsiProperty Name="INSTALLDIR" Value="[InstallFolder]" />
      </MsiPackage>

    </Chain>
  </Bundle>
</Wix>

And the burn log:

[30E4:5298][2019-02-16T22:19:37]i001: Burn v3.11.0.1701, Windows v10.0 (Build 15063: Service Pack 0), path: C:\Users\MATTLO~1.FLE\AppData\Local\Temp\{B3770523-AB08-419B-88D6-CE62D93B000F}\.cr\FlexSimInstaller.exe
[30E4:5298][2019-02-16T22:19:37]i009: Command Line: '-burn.clean.room=C:\Users\matt.long.FLEXSIM\Documents\FlexSimBootstrapper\BootstrapperSetup\bin\FlexSimInstaller.exe -burn.filehandle.attached=572 -burn.filehandle.self=512'
[30E4:5298][2019-02-16T22:19:37]i000: Setting string variable 'WixBundleOriginalSource' to value 'C:\Users\matt.long.FLEXSIM\Documents\FlexSimBootstrapper\BootstrapperSetup\bin\FlexSimInstaller.exe'
[30E4:5298][2019-02-16T22:19:37]i000: Setting string variable 'WixBundleOriginalSourceFolder' to value 'C:\Users\matt.long.FLEXSIM\Documents\FlexSimBootstrapper\BootstrapperSetup\bin\'
[30E4:5298][2019-02-16T22:19:37]i000: Setting string variable 'WixBundleLog' to value 'C:\Users\MATTLO~1.FLE\AppData\Local\Temp\FlexSim_2019_20190216221937.log'
[30E4:5298][2019-02-16T22:19:37]i000: Setting string variable 'WixBundleName' to value 'FlexSim 2019'
[30E4:5298][2019-02-16T22:19:37]i000: Setting string variable 'WixBundleManufacturer' to value 'FlexSim Software Products, Inc.'
[30E4:5298][2019-02-16T22:19:37]i000: Loading managed bootstrapper application.
[30E4:5298][2019-02-16T22:19:37]i000: Creating BA thread to run asynchronously.
[30E4:3DB0][2019-02-16T22:19:37]i000: Launching FlexSimBootstrapper UX
[30E4:5298][2019-02-16T22:19:37]i100: Detect begin, 1 packages
[30E4:5298][2019-02-16T22:19:37]i000: Setting numeric variable 'UCRTInstalled' to value 1
[30E4:5298][2019-02-16T22:19:37]i000: Setting string variable 'Netfx4x64FullVersion' to value '4.7.02046'
[30E4:5298][2019-02-16T22:19:37]i000: Setting string variable 'Netfx4FullVersion' to value '4.7.02046'
[30E4:5298][2019-02-16T22:19:37]i000: Registry key not found. Key = 'SOFTWARE\FlexSim\FlexSim 2019'
[30E4:5298][2019-02-16T22:19:37]i000: Registry key not found. Key = 'SOFTWARE\FlexSim\FlexSim 2019'
[30E4:5298][2019-02-16T22:19:37]i101: Detected package: FlexSim_x64, state: Absent, cached: None
[30E4:5298][2019-02-16T22:19:37]i199: Detect complete, result: 0x0
[30E4:3DB0][2019-02-16T22:19:51]i000: Setting string variable 'InstallFolder' to value 'C:\Program Files\FlexSim 2019'
[30E4:5298][2019-02-16T22:19:51]i200: Plan begin, 1 packages, action: Install
[30E4:5298][2019-02-16T22:19:51]i000: Setting string variable 'WixBundleRollbackLog_FlexSim_x64' to value 'C:\Users\MATTLO~1.FLE\AppData\Local\Temp\FlexSim_2019_20190216221937_000_FlexSim_x64_rollback.log'
[30E4:5298][2019-02-16T22:19:51]i000: Setting string variable 'WixBundleLog_FlexSim_x64' to value 'C:\Users\MATTLO~1.FLE\AppData\Local\Temp\FlexSim_2019_20190216221937_000_FlexSim_x64.log'
[30E4:5298][2019-02-16T22:19:51]i201: Planned package: FlexSim_x64, state: Absent, default requested: Present, ba requested: Present, execute: Install, rollback: Uninstall, cache: Yes, uncache: No, dependency: Register
[30E4:5298][2019-02-16T22:19:51]i299: Plan complete, result: 0x0
[30E4:5298][2019-02-16T22:19:51]i300: Apply begin
[30E4:5298][2019-02-16T22:19:51]i010: Launching elevated engine process.
[30E4:5298][2019-02-16T22:19:52]i011: Launched elevated engine process.
[30E4:5298][2019-02-16T22:19:52]i012: Connected to elevated engine.
[4540:4C1C][2019-02-16T22:19:52]i358: Pausing automatic updates.
[4540:4C1C][2019-02-16T22:19:52]i359: Paused automatic updates.
[4540:4C1C][2019-02-16T22:19:52]i360: Creating a system restore point.
[4540:4C1C][2019-02-16T22:19:52]i361: Created a system restore point.
[4540:4C1C][2019-02-16T22:19:52]i370: Session begin, registration key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{73366aa7-1a2c-44d4-a6f6-9a0536ab698f}, options: 0x7, disable resume: No
[4540:4C1C][2019-02-16T22:19:54]i000: Caching bundle from: 'C:\Users\MATTLO~1.FLE\AppData\Local\Temp\{8B0C2DBA-89AE-4102-A89F-81E466CB0A54}\.be\FlexSimInstaller.exe' to: 'C:\ProgramData\Package Cache\{73366aa7-1a2c-44d4-a6f6-9a0536ab698f}\FlexSimInstaller.exe'
[4540:4C1C][2019-02-16T22:19:54]i320: Registering bundle dependency provider: {73366aa7-1a2c-44d4-a6f6-9a0536ab698f}, version: 19.0.1.0
[4540:4C1C][2019-02-16T22:19:54]i371: Updating session, registration key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{73366aa7-1a2c-44d4-a6f6-9a0536ab698f}, resume: Active, restart initiated: No, disable resume: No
[30E4:1504][2019-02-16T22:19:54]i338: Acquiring package: FlexSim_x64, payload: FlexSim_x64, copy from: C:\Users\matt.long.FLEXSIM\Documents\FlexSimBootstrapper\BootstrapperSetup\bin\flexsim__19.0.1._x64
[30E4:1504][2019-02-16T22:19:54]i000: Setting string variable 'WixBundleLastUsedSource' to value 'C:\Users\matt.long.FLEXSIM\Documents\FlexSimBootstrapper\BootstrapperSetup\bin\'
[4540:0608][2019-02-16T22:19:55]i305: Verified acquired payload: FlexSim_x64 at path: C:\ProgramData\Package Cache\.unverified\FlexSim_x64, moving to: C:\ProgramData\Package Cache\{06448ACE-FFEC-4C33-B938-0104F3AC87D9}v17.0.2\flexsim__19.0.1._x64.
[4540:4C1C][2019-02-16T22:19:55]i323: Registering package dependency provider: {06448ACE-FFEC-4C33-B938-0104F3AC87D9}, version: 17.0.2, package: FlexSim_x64
[4540:4C1C][2019-02-16T22:19:55]i301: Applying execute package: FlexSim_x64, action: Install, path: C:\ProgramData\Package Cache\{06448ACE-FFEC-4C33-B938-0104F3AC87D9}v17.0.2\flexsim__19.0.1._x64, arguments: ' ARPSYSTEMCOMPONENT="1" MSIFASTINSTALL="7" INSTALLDIR="C:\Program Files\FlexSim 2019"'
[4540:4C1C][2019-02-16T22:20:31]e000: Error 0x80070642: Failed to install MSI package.
[4540:4C1C][2019-02-16T22:20:31]e000: Error 0x80070642: Failed to execute MSI package.
[30E4:5298][2019-02-16T22:20:31]e000: Error 0x80070642: Failed to configure per-machine MSI package.
[30E4:5298][2019-02-16T22:20:31]w350: Applied non-vital package: FlexSim_x64, encountered error: 0x80070642. Continuing...
[4540:4C1C][2019-02-16T22:20:31]i325: Registering dependency: {73366aa7-1a2c-44d4-a6f6-9a0536ab698f} on package provider: {06448ACE-FFEC-4C33-B938-0104F3AC87D9}, package: FlexSim_x64
[4540:4C1C][2019-02-16T22:20:31]i372: Session end, registration key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{73366aa7-1a2c-44d4-a6f6-9a0536ab698f}, resume: ARP, restart: None, disable resume: No
[4540:4C1C][2019-02-16T22:20:31]i371: Updating session, registration key: SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{73366aa7-1a2c-44d4-a6f6-9a0536ab698f}, resume: ARP, restart initiated: No, disable resume: No
[30E4:5298][2019-02-16T22:20:31]i399: Apply complete, result: 0x0, restart: None, ba requested restart:  No
[30E4:5298][2019-02-16T22:20:32]i500: Shutting down, exit code: 0x642
[30E4:5298][2019-02-16T22:20:32]i410: Variable: InstallFolder = C:\Program Files\FlexSim 2019
[30E4:5298][2019-02-16T22:20:32]i410: Variable: Netfx4FullVersion = 4.7.02046
[30E4:5298][2019-02-16T22:20:32]i410: Variable: Netfx4x64FullVersion = 4.7.02046
[30E4:5298][2019-02-16T22:20:32]i410: Variable: SystemFolder = C:\WINDOWS\SysWOW64\
[30E4:5298][2019-02-16T22:20:32]i410: Variable: UCRTInstalled = 1
[30E4:5298][2019-02-16T22:20:32]i410: Variable: WixBundleAction = 5
[30E4:5298][2019-02-16T22:20:32]i410: Variable: WixBundleElevated = 1
[30E4:5298][2019-02-16T22:20:32]i410: Variable: WixBundleLastUsedSource = C:\Users\matt.long.FLEXSIM\Documents\FlexSimBootstrapper\BootstrapperSetup\bin\
[30E4:5298][2019-02-16T22:20:32]i410: Variable: WixBundleLog = C:\Users\MATTLO~1.FLE\AppData\Local\Temp\FlexSim_2019_20190216221937.log
[30E4:5298][2019-02-16T22:20:32]i410: Variable: WixBundleLog_FlexSim_x64 = C:\Users\MATTLO~1.FLE\AppData\Local\Temp\FlexSim_2019_20190216221937_000_FlexSim_x64.log
[30E4:5298][2019-02-16T22:20:32]i410: Variable: WixBundleManufacturer = FlexSim Software Products, Inc.
[30E4:5298][2019-02-16T22:20:32]i410: Variable: WixBundleName = FlexSim 2019
[30E4:5298][2019-02-16T22:20:32]i410: Variable: WixBundleOriginalSource = C:\Users\matt.long.FLEXSIM\Documents\FlexSimBootstrapper\BootstrapperSetup\bin\FlexSimInstaller.exe
[30E4:5298][2019-02-16T22:20:32]i410: Variable: WixBundleOriginalSourceFolder = C:\Users\matt.long.FLEXSIM\Documents\FlexSimBootstrapper\BootstrapperSetup\bin\
[30E4:5298][2019-02-16T22:20:32]i410: Variable: WixBundleProviderKey = {73366aa7-1a2c-44d4-a6f6-9a0536ab698f}
[30E4:5298][2019-02-16T22:20:32]i410: Variable: WixBundleRollbackLog_FlexSim_x64 = C:\Users\MATTLO~1.FLE\AppData\Local\Temp\FlexSim_2019_20190216221937_000_FlexSim_x64_rollback.log
[30E4:5298][2019-02-16T22:20:32]i410: Variable: WixBundleSourceProcessFolder = C:\Users\matt.long.FLEXSIM\Documents\FlexSimBootstrapper\BootstrapperSetup\bin\
[30E4:5298][2019-02-16T22:20:32]i410: Variable: WixBundleSourceProcessPath = C:\Users\matt.long.FLEXSIM\Documents\FlexSimBootstrapper\BootstrapperSetup\bin\FlexSimInstaller.exe
[30E4:5298][2019-02-16T22:20:32]i410: Variable: WixBundleTag = FlexSim
[30E4:5298][2019-02-16T22:20:32]i410: Variable: WixBundleUILevel = 4
[30E4:5298][2019-02-16T22:20:32]i410: Variable: WixBundleVersion = 19.0.1.0
[30E4:5298][2019-02-16T22:20:32]i007: Exit code: 0x642, restarting: No
wix
bootstrapper
burn
arp
asked on Stack Overflow Feb 17, 2019 by Matt Long

1 Answer

1

Vital Attribute: I think the cause is that you have set the MsiPackage to be Vital="no". When you do this you tell the Bundle to keep installing even if it rolls back the MSI in question. So please try setting Vital="yes" and test again.


Comments: Note that I tested with a test bundle and not your code above - the main difference being your custom bootstrapper application, and me using the default one. So there could be other causes for the problem seen - for example your custom bootstrapper application or the RelatedBundle construct that I have never tried.

answered on Stack Overflow Feb 17, 2019 by Stein Åsmul • edited Feb 17, 2019 by Stein Åsmul

User contributions licensed under CC BY-SA 3.0