问题
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