Question

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>
    
Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top