Wix Bootstrapper Update UI (XAML) from CustomAction

风流意气都作罢 提交于 2020-01-25 11:52:33

问题


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:


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);
}


来源:https://stackoverflow.com/questions/30933148/wix-bootstrapper-update-ui-xaml-from-customaction

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!