1

Below is the source code for two very basic burn bootstrappers. Bootstrapper installs 2 MSI packages and then SP1 performs a major upgrade on the appdata MSI package. Initially this works very well except that I have several servicing probems.

  1. When I remove the parent bootstrapper, it is smart enough to remove the child SP1 patch. However, when I remove the SP1 update from Add/Remove programs, there isn't any appdata installed at all. I have to perform a repair on the original Bootstrapper bundle to get the original version of appdata reinstalled. Is this a bug or have I implemented it wrong?

  2. I am able to install the SP1 bundle by itself. How can I prevent SP1 from being installed if Bootstrapper isn't already installed?

  3. If I create a Bootstrapper 2.0 it supersedes Bootstrapper 1.0 and SP1 correctly. If I run Bootstrapper 1.0 it correctly blocks. But if I run SP1 it installs. How can I constrain SP1 to Bootsrapper v1 only?

  4. If the first two items aren't currently possible, is it possible to create an SP1 that is not removable? ( Force removal and reinstallation of parent bundle to get back to the original state. ) I see how to use the DisableRemove and DisableModify attributes but then it doesn't show up in Add/Remove Programs at all and the user can still go back to the EXE and use the WiXStdBA to remove the bundle.

    <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
        <Bundle Manufacturer="ISWIX" Name="Bootstrapper" UpgradeCode="44a1059e-e7f7-46c7-9627-b720d6417d69" Version="1.0.0.0">
            <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense"/>
            <Chain>
                <MsiPackage SourceFile="app-1.0.msi"/>
                <MsiPackage SourceFile="appdata-1.0.msi"/>
            </Chain>
        </Bundle>
    </Wix>
    
    <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
        <Bundle Manufacturer="ISWIX" Name="SP1" ParentName="Bootstrapper" UpgradeCode="44a1059e-e7f7-46c7-9627-b720d6417d69" Version="1.0.0.1">
            <RelatedBundle Action="Patch" Id="44a1059e-e7f7-46c7-9627-b720d6417d69"/>
            <BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense"/>
            <Chain>
                <MsiPackage SourceFile="appdata-1.1.msi"/>
            </Chain>
        </Bundle>
    </Wix>
    
Justin
  • 84,773
  • 49
  • 224
  • 367
Christopher Painter
  • 54,556
  • 6
  • 63
  • 100
  • Sorry, I posted XML but it wouldn't render. This is the best I could come up with to share. – Christopher Painter Oct 31 '13 at 14:23
  • why dont you use the code sample {} to paste the actual XML. – Isaiah4110 Oct 31 '13 at 21:42
  • I tried over and over. When I pasted just the XML it wouldn't show it all. When I put it in a quote block or code block it rendered all weird. – Christopher Painter Oct 31 '13 at 23:48
  • Check this question, http://stackoverflow.com/questions/13052950/wix-burn-uninstallation – Isaiah4110 Nov 01 '13 at 21:58
  • 1
    @ChristopherPainter: regarding the formatting, see http://meta.stackexchange.com/questions/3327/code-block-is-not-properly-formatted-when-placed-immediately-after-a-list-item - in your case, I'd go with add-a-comment, as the code block isn't semantically part of the list. – Michael Urman Nov 04 '13 at 14:34

1 Answers1

2

For stopping your SP1 from being installed without the original bootstrapper you can make use of one of the following options:

Option 1: Make use of the bundle/@Condition attribute

<Bundle
    Name="Test123" Version="1.0.0.0"
    Manufacturer="abc cORP" UpgradeCode=""
    Condition="((VersionNT = v6.0)">
</Bundle>

This will only work with prebuilt wix burn variables. Detailed list of variables can be found here:LINK

Option 2: The second method makes use of the WIXBALExtension Condition element:

<bal:Condition
   Message="The Bootstrapper has to be installed in version $(var.BaselineVersion)">  
      WixBundleInstalled OR      
      ((SampleMsiInstalledState = 5) AND (SampleMsiInstalledVersion &gt;= v$(var.BaselineVersion)))
</bal:Condition>
<util:ProductSearch Guid="[msi_prerequisite_package_product_code]"
    Result="version" Variable="SampleMsiInstalledVersion" />
<util:ProductSearch Guid="[msi_prerequisite_package_product_code]"
    Result="state" Variable="SampleMsiInstalledState" />

Here we use a ProductSearch from the WixUtilExtension to find the state and versions of related msi packages. The version is then compared to the minimum version of a bundle that's required for the bundle (BasellineVersion).

Related Link 1 Related Link 2

Isaiah4110
  • 9,855
  • 1
  • 40
  • 56