Passing user input to a bundled MSI
One reason for authoring a new user interface is to collect user information that the standard Burn UI doesn't enable us to. For example, suppose we wanted to collect a username? This is actually quite easy. We will use the StringVariables
property on the Engine
class. This property is a collection of key-value pairs and can be used to set a Burn variable.
We could start off by adding a new method to our BootstrapperApplicationModel
class called SetBurnVariable
. The following is the code:
public void SetBurnVariable(string variableName, string value) { this.BootstrapperApplication.Engine .StringVariables[variableName] = value; }
This method will now accept the name of the variable that we want to set and the value to set it to. It passes this information to the StringVariables
property, which passes it to the bootstrapper.
To use this we might add a new TextBox
control to our view to collect a username. The following is the markup for a TextBox
control...