2015-06-19 43 views
0

我實現了自定義bootstrapper應用程序(根據本教程http://bryanpjohnston.com/2012/09/28/custom-wix-managed-bootstrapper-application/安裝幾個MSI-files的UI由幾個XAML-files(XAML) 我用ExecuteMsiMessage-event顯示用戶當前操作:維克斯引導程序更新UI從CustomAction

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

bootstrapper我使用CustomAction更新VFP-database。在這個CustomAction我要報告當前步驟,給用戶了。在這裏Wix CustomAction update UI?我發現如何更新WIX-properties一些信息。 是否還有一種方法可以從CustomAction內更新我的ViewModel中的屬性currentAction

回答

0

你應該添加CustomAction代碼,以便它更明顯你想達到什麼樣的,但是,鑑於當前的代碼,下面將更新您的視圖模型:

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

首先,感謝您的回覆。 你能告訴我如何在我的viewModel中「獲取」消息嗎?它在OnExecuteMsiMessage中沒有被捕獲。我可以在'MSI'的日誌中看到該消息,但不能看到'BootStrapper'的日誌中。 – user2219063