Select which .msi to install/uninstall

Apr 23, 2013 at 5:45 PM
Edited Apr 25, 2013 at 6:28 PM
First, I have to say, thank you for sharing this project, it makes Burn finally something usable for me!

I’m trying to re-create something like the feature selection dialog from .msi installers. Only, my goal is to install/modify specific .msi files.

I started working from “Bundle4.wxs”, and added a second dummy “setup1.msi”. So far, I have this:
<?xml version="1.0"?>
<!--
  This example demonstrates the use of an external theme file to create the same UI as 
  Hyperlink2License built in to WixBalExtensionExt.
  
  It also shows the use of checkboxes on the install and option pages.
-->
<Wix RequiredVersion="3.7.1224.0" 
  xmlns="http://schemas.microsoft.com/wix/2006/wi"
  xmlns:bal="http://schemas.microsoft.com/wix/BalExtension"
  xmlns:util="http://schemas.microsoft.com/wix/UtilExtension">
  <Bundle Name="MyApp 5.02" Version="$(bal.Version(1.0))" UpgradeCode="{1B549EA6-68A8-4B75-BFDD-F6D61313396C}"
    Manufacturer="ACME"
    AboutUrl="http://wixtoolset.org">

    <BootstrapperApplicationRef Id="WixExtendedBootstrapperApplication.HyperlinkLicense">
      <Payload SourceFile="Resource\LogoSide.png" />
      <Payload SourceFile="Resource\Logo.png" />
    </BootstrapperApplicationRef>
    <WixVariable Id="WixExtbaLicenseUrl" Value="License.htm" />
    <WixVariable Id="WixExtbaThemeXml" Value="Resource\Bundle4aTheme.xml" />
    <WixVariable Id="WixExtbaThemeWxl" Value="Resource\HyperlinkTheme.wxl" />

    <Variable Name="InstallFolder" Type="string" Value="[ProgramFilesFolder]ACME" />
<!--
    <Variable Name="InstallFolder2" Type="string" Value="[WindowsVolume]Database" />
-->
    <Variable Name="Checkbox1" Type="numeric" Value="1" />
    <Variable Name="Checkbox2" Type="numeric" Value="1" />
    <Variable Name="Checkbox3" Type="numeric" Value="1" />
    <Variable Name="Checkbox4" Type="numeric" Value="1" />
    <Variable Name="Checkbox5" Type="numeric" Value="1" />
    <Variable Name="Checkbox6" Type="numeric" Value="1" />

    <Chain DisableSystemRestore="yes">
      <PackageGroupRef Id="NetFx40Redist" />
      <MsiPackage
        Id="Setup"
        Compressed="no"
        SourceFile="Setup.msi"
        Vital="yes"
        InstallCondition="Checkbox1">
        <MsiProperty Name="APPLICATIONFOLDER" Value="[InstallFolder]" />
      </MsiPackage>
      <MsiPackage
        Id="Setup1"
        Compressed="no"
        SourceFile="Setup1.msi"
        Vital="yes"
        InstallCondition="Checkbox2">
        <MsiProperty Name="APPLICATIONFOLDER" Value="[InstallFolder]" />
      </MsiPackage>
    </Chain>

  </Bundle>
</Wix>
(Plus the mods to Bundle4aTheme.xml) And it works great, except when I get to the “maintenance” dialog; I would like to somehow set the “Checkbox” variables to whether or not setup.msi and setup1.msi are installed, so that I can let the user modify which .msi files are installed. Looking at the .log file:
[171C:1034][2013-04-23T11:49:24]i001: Burn v3.7.1224.0, Windows v6.2 (Build 9200: Service Pack 0), path: C:\Data\Deploy\WixBalExtensionExt-20130319\Examples\Bundle4a.exe, cmdline: ''
[171C:1034][2013-04-23T11:49:24]i000: Initializing string variable 'InstallFolder' to value '[ProgramFilesFolder]ACME'
[171C:1034][2013-04-23T11:49:24]i000: Initializing numeric variable 'Checkbox1' to value '1'
[171C:1034][2013-04-23T11:49:24]i000: Initializing numeric variable 'Checkbox2' to value '1'
[171C:1034][2013-04-23T11:49:24]i000: Initializing numeric variable 'Checkbox3' to value '1'
[171C:1034][2013-04-23T11:49:24]i000: Initializing numeric variable 'Checkbox4' to value '1'
[171C:1034][2013-04-23T11:49:24]i000: Initializing numeric variable 'Checkbox5' to value '1'
[171C:1034][2013-04-23T11:49:24]i000: Initializing numeric variable 'Checkbox6' to value '1'
[171C:1034][2013-04-23T11:49:24]i000: Setting string variable 'WixBundleLog' to value 'C:\Users\Folder~1\AppData\Local\Temp\MyApp_5.02_20130423114924.log'
[171C:1034][2013-04-23T11:49:24]i000: Setting string variable 'WixBundleOriginalSource' to value 'C:\Data\Deploy\WixBalExtensionExt-20130319\Examples\Bundle4a.exe'
[171C:1034][2013-04-23T11:49:24]i100: Detect begin, 3 packages
[171C:1034][2013-04-23T11:49:24]i000: Setting string variable 'NETFRAMEWORK40' to value '1'
[171C:1034][2013-04-23T11:49:24]i052: Condition 'NETFRAMEWORK40' evaluates to true.
[171C:1034][2013-04-23T11:49:24]i101: Detected package: NetFx40Redist, state: Present, cached: None
[171C:1034][2013-04-23T11:49:24]i101: Detected package: Setup, state: Present, cached: Complete
[171C:1034][2013-04-23T11:49:24]i101: Detected package: Setup1, state: Present, cached: Complete
[171C:1034][2013-04-23T11:49:24]i199: Detect complete, result: 0x0
It looks like it should be deceivingly simple to grab the state of my setup.msi and setup1.msi, and set it into one of the CheckBox variables for the "modify" operation … but how do I do it?
Coordinator
Apr 23, 2013 at 5:55 PM
I don't know of a way of detecting the state of your MSIs other than getting them to write a registry key that you then search for.
Apr 25, 2013 at 6:26 PM
Thank you! I also got a suggestion from Rob to make the Variable as Persisted='yes' - I'll have to think through which way will work best because of the different SKUs I'm shipping.

Now, I ran into another hurdle; the "Modify Setup" dialog only includes "Repair", "Uninstall", and "Close" options. I know how to add the checkboxes, and link them to Variables, but where is the "Modify (which .msi's are installed)" button? I tried adding the "Install" button from the "Install" dialog, but that seems to just un-install my MSI's and re-set all my Variables to false.

I tried to read through src\ext\BalExtension\wixstdba\WixStandardBootstrapperApplication.cpp, and it looks like the "Modify" button on the "Modify" page is missing.
Coordinator
Apr 26, 2013 at 3:56 PM
Unfortunately there isn't a UI for modify, the code path does repair and modify with the same UI. I did take a look at changing this but didn't come up with a stable solution.
Apr 29, 2013 at 7:39 PM
Thank you! I did try the "repair" path, and it does work. However, the "repair" path will repair everything, including heavy-weight (relatively speaking) pre-requisites like the .NET framework. (My .msi package sizes are not well balanced, one being 500 MB of pdf files, another being 10 MB of executables, etc.) If there is a wish-list for things to have in a future release, you have my vote for this one!