2014-03-04 108 views
0

我有一個自定義操作,返回ActionResult.UserExit,據我所知應該停止安裝繼續。但似乎並非如此。安裝繼續,就像自定義操作成功。返回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 

我在這裏錯過了什麼?

回答

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

+0

的ActionResult是從管理的自定義操作返回值時使用的枚舉。 ActionResult.UserExit確實定義爲1602.它只是在日誌中顯示爲2,如http://msdn.microsoft.com/en-us/library/aa369778%28v=vs.85%29.aspx – chickenpie

+0

我的猜測是您需要使用Exit安排EndDialog操作。我不確定返回退出的自定義操作在UI中的行爲是否相同(與直接從序列中調用相反)。 – PhilDW

相關問題