Wix Bootstrapper Update UI (XAML) from CustomAction

463 views Asked by At

I have implemented a custom bootstrapper application (based on this tutorial http://bryanpjohnston.com/2012/09/28/custom-wix-managed-bootstrapper-application/ to install several MSI-files. The UI consists of several XAML-files. I use the ExecuteMsiMessage-event to show the user the current actions:

private void OnExecuteMsiMessage(object sender, ExecuteMsiMessageEventArgs e)
    {
        lock (this)
        {
            this.currentAction = (string)e.Data[0];
        }
    }

In the bootstrapper I use a CustomAction to update a VFP-database. Within this CustomAction I want to report the current steps to the user, too. Here Wix CustomAction update UI? I found some information on how to update WIX-properties. Is there also a way to update the property currentAction in my ViewModel from within the CustomAction?

1

There are 1 answers

1
abbottdev On

You should add your CustomAction code so it's more obvious what you're trying to achieve, but, given your current code, the following would update your viewModel:

[CustomAction]
public static ActionResult MyCustomAction(Session session)
{
    Record record = new Record(0);
    record.SetString(0, "My Custom Message");
    session.Message(InstallMessage.Info, record);
}