2013-09-24 31 views
0

我正在使用Wix創建基於MSI的安裝程序。自定義操作session.message不顯示消息框

我的自定義操作的聲明是這樣的......

<Binary Id="CustomActions" SourceFile="DLLs\CustomActions.CA.dll" /> 

<CustomAction Id="CheckPath" Return="check" Execute="immediate" BinaryKey="CustomActions" DllEntry="CheckPath" /> 

而下WixUI_InstallDir對話UI,

<UI Id="WixUI_InstallDir"> 
    ..... 
    <Publish Dialog="SelectDirDlg" Control="Next" Event="DoAction" Value="CheckPath" Order="2">1</Publish> 
    ..... 
</UI> 

而在C#文件,

[CustomAction] 
public static ActionResult CheckPath(Session session) 
{ 
     Record record2 = new Record(); 
     record.FormatString = "The path that you have selected is invalid!"; 
     session.Message(InstallMessage.Error | (InstallMessage)MessageButtons.OK, record); 
     return ActionResult.Success; 
} 

我期待當用戶選擇無效路徑時,通過上述自定義動作的消息框。但消息框未顯示。

我在做什麼錯?

回答