WiX: dynamically changing the status text during CustomAction

Deferred Custom Actions can call the MsiProcessMessage function. You can then use INSTALLMESSAGE_ACTIONSTART, INSTALLMESSAGE_ACTIONDATA and INSTALLMESSAGE_PROGRESS to publish messages up to the UI.

Another possibility would be to break your custom action up into smaller custom actions and use the ProgressText (ActionText table) to describe different phases of installation. ( Make each CA have a single responsibility. )

Sometimes when a CA does too much work it's hard to plan rollbacks correctly.

Obtaining Context Information for Deferred Execution Custom Actions

MsiProcessMessage function

Using C#/DTF it looks something like:

    using (Record record = new Record(0))
    {
        record.SetString(0, "foo");
        session.Message(InstallMessage.ActionData, record);
    }

The using statement disposes the record to free up the underlying MSI handles. The number of fields in the record and how you set the data is going to depend on the template defined in the ActionText table.

Tags:

Wix

Wix3.5