返回ActionResult.UserExit似乎没有任何效果

时间:2014-03-04 16:49:16

标签: wix custom-action

我有一个自定义操作,返回ActionResult.UserExit,据我所知,应该停止安装继续进行。然而,情况似乎并非如此。安装继续,就像自定义操作成功一样。

自定义操作CheckMILInstallation定义为:

<CustomAction Id="CheckMILInstallation" BinaryKey="CustomActions" DllEntry="CheckMILInstallation"></CustomAction>

并从对话框按钮触发:

<Publish Dialog="DASetupTypeDlg"       Control="Back" Event="NewDialog" Value="DALicenseDlg">1</Publish>
<Publish Dialog="DASetupTypeDlg"       Control="Next" Event="DoAction"  Value="CheckMILInstallation" order="1">1</Publish>
<Publish Dialog="DASetupTypeDlg"       Control="Next" Property="NextDialog"                 Value="VerifyReadyDlg" Order="2">1</Publish>
<Publish Dialog="DASetupTypeDlg"       Control="Next" Property="VerifyReadyDlg_Back"        Value="DASetupTypeDlg" Order="2">1</Publish>
<Publish Dialog="DASetupTypeDlg"       Control="Next" Property="NextDialog"                 Value="DAInstallCSWDlg" Order="3">INSTALLIDE="1" AND VS2010_VCSHARP_FOLDER</Publish>
<Publish Dialog="DASetupTypeDlg"       Control="Next" Property="DAInstallCSWDlg_Back"       Value="DASetupTypeDlg"  Order="3">INSTALLIDE="1" AND VS2010_VCSHARP_FOLDER</Publish>
<Publish Dialog="DASetupTypeDlg"       Control="Next" Property="NextDialog"                 Value="DAStartWebsiteDlg" Order="4">INSTALLRT="1" AND CONFLICTING_WEBSITE</Publish>
<Publish Dialog="DASetupTypeDlg"       Control="Next" Property="DAStartWebsiteDlg_Back"     Value="DASetupTypeDlg"    Order="4">INSTALLRT="1" AND CONFLICTING_WEBSITE</Publish>
<Publish Dialog="DASetupTypeDlg"       Control="Next" Property="NextDialog"                 Value="DAMultiInstallDirDlg" Order="5">InstallPathEditable OR ExamplesPathEditable</Publish>
<Publish Dialog="DASetupTypeDlg"       Control="Next" Property="DAMultiInstallDirDlg_Back"  Value="DASetupTypeDlg"       Order="5">InstallPathEditable OR ExamplesPathEditable</Publish>      
<Publish Dialog="DASetupTypeDlg"       Control="Next" Event="NewDialog" Value="[NextDialog]" Order="6">1</Publish>

MSI日志确实指示了正确的返回值,但随后继续创建下一个对话框,就像它成功了一样:

MSI (c) (78:EC) [11:05:56:926]: Doing action: CheckMILInstallation
Action 11:05:56: CheckMILInstallation. 
Action start 11:05:56: CheckMILInstallation.
MSI (c) (78:CC) [11:05:56:926]: Invoking remote custom action. DLL: C:\Users\david\AppData\Local\Temp\MSI6F00.tmp, Entrypoint: CheckMILInstallation
Action ended 11:06:00: CheckMILInstallation. Return value 2.
MSI (c) (78:EC) [11:06:00:582]: Note: 1: 2727 2:  
MSI (c) (78:EC) [11:06:00:582]: PROPERTY CHANGE: Adding NextDialog property. Its value is 'VerifyReadyDlg'.
MSI (c) (78:EC) [11:06:00:582]: PROPERTY CHANGE: Adding VerifyReadyDlg_Back property. Its value is 'DASetupTypeDlg'.
MSI (c) (78:EC) [11:06:00:582]: PROPERTY CHANGE: Modifying NextDialog property. Its current value is 'VerifyReadyDlg'. Its new value: 'DAInstallCSWDlg'.
MSI (c) (78:EC) [11:06:00:582]: PROPERTY CHANGE: Adding DAInstallCSWDlg_Back property. Its value is 'DASetupTypeDlg'.
MSI (c) (78:EC) [11:06:00:582]: PROPERTY CHANGE: Modifying NextDialog property. Its current value is 'DAInstallCSWDlg'. Its new value: 'DAMultiInstallDirDlg'.
MSI (c) (78:EC) [11:06:00:582]: PROPERTY CHANGE: Adding DAMultiInstallDirDlg_Back property. Its value is 'DASetupTypeDlg'.
Action 11:06:00: DAMultiInstallDirDlg. Dialog created

我在这里缺少什么?

1 个答案:

答案 0 :(得分:0)

我不确定您的ActionResult.UserExit的定义位置,但文档似乎表明该值应为1602,而不是2为用户出口。值2似乎保留用于脚本自定义操作的结果。

http://msdn.microsoft.com/en-us/library/aa368072(v=vs.85).aspx

脚本CA返回值:

http://msdn.microsoft.com/en-us/library/aa371254(v=vs.85).aspx