9

I have a WiX 3.6 bundle (using Burn) and managed bootstrapper that install several MSI packages. Some of the packages install to a common location (C:\program files\MyApp).

I want to let the user choose the install location inside the managed bootstrapper application (C# WPF, especially because the application is large to install; about 1 GB). How can I specify the INSTALLLOCATION for each MSI packages inside my bundle?

Peter Mortensen
  • 30,030
  • 21
  • 100
  • 124
decasteljau
  • 7,315
  • 10
  • 39
  • 57

1 Answers1

12

Use an MsiProperty child for each MsiPackage to specify INSTALLLOCATION=[BurnVariable]. Then use Engine.StringVariables to set BurnVariable.

For example, in your bundle you set:

<Bundle ...>
    <Variable Name='BurnVariable' Value='bar' />
    ...
    <Chain>
        <MsiPackage Source='path\to\your.msi'>
            <MsiProperty Name="INSTALLLOCATION" Value="[BurnVariable]" />
        </MsiPackage>
    </Chain>
</Bundle>    

See also the FireGiant explanation on this topic.

Then in the managed bootstrapper you can do something similar to this:

Engine.StringVariables["BurnVariable"] = "C:\program files\MyApp";
Ewoud
  • 12,645
  • 5
  • 16
  • 23
Bob Arnson
  • 20,055
  • 2
  • 38
  • 46
  • I am trying to read some environment variables from burn and pass it to the MSI's within, but I use the default BA. Can you explain what I need to do? I saw the code in variable.cpp burn -> engine. Is that where I have to add the new variable? – Isaiah4110 Nov 12 '12 at 21:36