本文介绍了来自CustomAction的Wix引导程序更新UI(XAML)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经实现了自定义的 bootstrapper 应用程序(基于本教程安装多个 MSI文件。用户界面由几个 XAML文件组成。
我使用 ExecuteMsiMessage-事件向用户显示当前操作:

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

引导程序中,我使用 CustomAction 更新 VFP数据库。在此 CustomAction 中,我要报告当前对用户也是如此。在这里我找到了一些有关如何更新 WIX属性的信息。
还有一种方法可以从<$ c $中更新我的 ViewModel 中的属性 currentAction c> CustomAction ?

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?

推荐答案

您应该添加CustomAction代码,以便更清楚地了解要实现的目标,但是,鉴于当前的代码,以下将更新您的viewModel:

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

这篇关于来自CustomAction的Wix引导程序更新UI(XAML)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 23:39