3

I was looking at the solution presented here:

WiX Burn - Determine what items are already installed

But I don't see how this could work for a "modify" Burn screen (when somebody decides to remove a certain .msi).

Looking at the Burn .log when the uninstall/modify page shows up (I called my variables that describe whether a check box is checked, 'Checkbox1' through 'Checkbox6'):

[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'

(etc.)

[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

So, this makes me wonder, where are the results of "Detect" for the various .msi's stored? Why can't they be stored into my own variable, 'Checkbox1', that I later use to set the value of a checkbox, whether it's checked or not?

As a more fundamental question, isn't this usage pattern of Burn one of the key usage patterns that should be well supported in the standard UI...

Community
  • 1
  • 1
user2313654
  • 55
  • 1
  • 3

1 Answers1

7

You can control whether a package should be installed by setting it's InstallCondition attribute. For example, if Checkbox1 was determined whether Msi1 should be installed, you're chain could have:

<MsiPackage Id='Msi1' InstallCondition='Checkbox1' SourceFile='path\to\msi1.msi' />

You'd probably want to define your Checkbox1 variable such that it persisted it's value:

<Variable Name='Checkbox1` Value='1' Persisted='yes' />

Note: This by default assumes Msi1 should be installed because the value is defaulted to '1'.

The only thing left is to tie your Checkbox1 to UI in the wixstdba. You can do this by overriding the Theme file and adding checkboxes to the Options page that use Checkbox1 as the @Id of the control.

Rob Mensching
  • 33,834
  • 5
  • 90
  • 130
  • Just what I was looking for, thank you! There was a really nice UI I started with at http://wixextba.codeplex.com/ - I'm just adding a little change here or there. – user2313654 Apr 24 '13 at 13:33