10
我是初學者,開始學習WiX。我想在安裝過程中捕獲並驗證並註冊用戶詳細信息。我創建了一個對話框來捕獲用戶註冊並在用戶點擊「下一步」後調用自定義操作。從對話框調用CustomAction時,WiX安裝錯誤2762
但是在這裏我得到了安裝程序錯誤2762.雖然錯誤描述說「該操作必須安排在InstallInitialize和InstallFinalize之間」,但我無法弄清楚如何解決這個問題。
這裏是我的XML腳本:
<Binary Id="mycustom"
SourceFile="..\CustomAction1\bin\Debug\CustomAction1.CA.dll" />
<CustomAction Id="myCustomValidate"
BinaryKey="mycustom"
DllEntry="ValidateCustomAction"
Execute="deferred"
Return="check">
</CustomAction>
<UI>
<UIRef Id="WixUI_Mondo" />
<Dialog Id="UserRegistrationDlg"
Width="370"
Height="270"
Title="[ProductName] [Setup]"
NoMinimize="yes">
..
..
..
<Control Id="Next"
Type="PushButton"
X="236"
Y="243"
Width="56"
Height="17"
Default="yes"
Text="[ButtonText_Next]">
<Publish Event="ValidateProductID" Value="0">1</Publish>
<Publish Event="DoAction" Value="myCustomValidate">1</Publish>
<Publish Event="SpawnDialog" Value="InvalidRegDlg">PIDACCEPTED = "0"</Publish>
<Publish Event="NewDialog" Value="SetupTypeDlg">ProductID AND PIDACCEPTED = "1"</Publish>
</Control>
</Dialog>
</UI>
以下是我使用的自定義操作代碼。如果在 「InstallExecuteSequence」 使用
[CustomAction]
public static ActionResult ValidateCustomAction(Session session)
{
return ActionResult.Success;
}
自定義操作工作正常。我無法找出問題,我刪除了自定義對話框,並使用以下簡單調用來調用自定義操作。但是,我結束了同樣的錯誤。
<Publish Dialog="LicenseAgreementDlg"
Control="Next"
Event="DoAction"
Value="myCustomValidate">1</Publish>
我確定我在這裏做了些傻事,但搞不清楚。解決辦法是什麼?
像魅力一樣工作。謝謝!!! – user961330 2011-12-21 15:09:39