Search code examples
wixwindows-installerburn

Wix burn does not stop and remove service


I have bootstrapper installer created with burn which contains 4 msi where 3 of them are installed (depend on OS).

One of the installers installs service and runs it. If I only use this one for uninstall, the service is being stopped and removed from the services list. But if I do an uninstall with the bootstrapper installer, service remains in the list and is shown as running (even though all the files are removed and service is not running in a real).

Does anyone have any idea what might be the difference between uninstall from msi and from the exe bootstrapper (where the same msi is packed)?

Service installation:

<Component Id="ComponentId" Guid="someguid-4C46-832F-B3E7E063713A">
        <File Id="ExeFile" Checksum="yes" KeyPath="yes" Source="service.exe" />
        <ServiceInstall DisplayName="[ProductName]"
                        Name="myservice"
                        Id="ServiceInstall"
                        Start="auto"
                        ErrorControl="normal"
                        Type="ownProcess"
                        Account="[ACCOUNTUSER]"
                        Password="[ACCOUNTPASSWORD]" />
        <ServiceControl Id="ServiceControl"
                        Name="myservice"
                        Remove="uninstall"
                        Wait="yes"
                        Start="install"
                        Stop="both" />
</Component>

And the bootstrapper:

<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:bal="http://schemas.microsoft.com/wix/BalExtension">
    <Bundle Name="MyBundle" Version="1.0.0.0" Manufacturer="Me" UpgradeCode="someguid-40da-bda2-1e46a5a55c47">
    <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.HyperlinkLicense">
      <bal:WixStandardBootstrapperApplication LicenseUrl="" SuppressOptionsUI="yes" LogoFile="logo.bmp" SuppressRepair="yes" />
    </BootstrapperApplicationRef>

    <Chain>
      <MsiPackage
              Id="App1"
              SourceFile="App1_x86.msi"
              InstallCondition="NOT VersionNT64"
              DisplayInternalUI="yes"
              Permanent="no" />

      <MsiPackage
              Id="App1"
              SourceFile="App1_x64.msi"
              InstallCondition="VersionNT64" 
              DisplayInternalUI="yes"
              Permanent="no" />

      <MsiPackage
              Id="App2"
              SourceFile="App2.msi"
              DisplayInternalUI="yes"
              Permanent="no" />

      <MsiPackage Id="Service"
              SourceFile="Service.msi"
              DisplayInternalUI="yes"
              Permanent="no" />
        </Chain>
    </Bundle>
</Wix>

Solution

  • I have figured out this, there might be a problem with killing all running instances when uninstalling App2. I have solved this by changing an order of the last two install packages and now it removes the product just fine, including to stop and remove the service.