2013-07-01 1 views
1

CustomAction에 오류가 표시되면 설치를 중지 할 수 있습니까? 내가 사용자 정의 액션 안에 오류 메시지를 표시 할 수 있고 오류 메시지가 표시되지만 확인 버튼을 클릭하자마자 내 다음 UI 시퀀스 양식이 나타납니다. 버튼을 끝내려면 어떻게해야합니까? 내 소스 코드 추가WIX 설치 프로그램이있는 사용자 지정 작업 내에서 설치 오류가 발생합니다.

:

<Binary Id="BIN_CustomAction" SourceFile="CustomAction.CA.dll" /> 
     <CustomAction Id="CA_CheckList" BinaryKey="BIN_CustomAction" DllEntry="CA_CheckList" Execute="immediate" Impersonate="yes" Return="ignore" /> 

     <UI Id="MyWixUI_Mondo"> 
      <UIRef Id="WixUI_Mondo" /> 
      <UIRef Id="WixUI_ErrorProgressText" /> 
      <DialogRef Id="UserRegistrationDlg" /> 
      <Dialog Id="UserRegistrationDlg" Width="370" Height="270" Title="[ProductName] Setup" NoMinimize="yes"> 

       <Control Id="ComboBoxMain" Type="ComboBox" X="124" Y="158" Width="241" Height="16" Property="LOCATIONNAME"> 
       </Control> 
       <Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="&amp;Back"> 
        <Publish Event="NewDialog" Value="LicenseAgreementDlg">1</Publish> 
       </Control> 


       <Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="&amp;Next"> 
        <Publish Event="SpawnDialog" Value="SetupTypeDlg">1</Publish> 
       </Control> 
       <Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="Cancel"> 
        <Publish Event="SpawnDialog" Value="CancelDlg">1</Publish> 
       </Control> 

      </Dialog> 

      <Control Id="Next" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="&amp;NExt"> 
       <Publish Event="DoAction" Value="RadioButtonCheck">1</Publish> 
      </Control> 
      </Dialog>--> 
      <Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog" Value="UserRegistrationDlg" Order="3"> 
     LicenseAccepted = "1" 
     </Publish> 
      <Publish Dialog="SetupTypeDlg" Control="Back" Event="NewDialog" Value="UserRegistrationDlg">1</Publish> 
     </UI> 
     <InstallUISequence> 
      <Custom Action="CA_CheckList" Before="AppSearch">Not Installed</Custom> 
     </InstallUISequence> 

     [CustomAction] 
     public static ActionResult CA_CheckList(Session session) 
     { 


      if (installer.ListStatus == false) 
      { 

       // dispaly 
       Record record = new Record(); 
       record.FormatString = string.Format("Error!"); 

       session.Message(
        InstallMessage.Error | (InstallMessage)(MessageIcon.Error) | 
        (InstallMessage)MessageButtons.OK,record); 

       return ActionResult.Failure; 

      } 
      else 
      { 
       return ActionResult.Success; 
      } 



     } 

하는 것도 한 번 내가 이미지의 확인 버튼을 클릭 증명하는 스크린 샷을 추가하기 (1) 나의 다음 대화, 즉 이미지 (2) 나타나고있다 : - 내가이 필요한 대신 오류가 발생하면 완료 대화 상자를 클릭하십시오.

1) Error Message appears

2) Next Dialog

Any idea??kindly help me. 

답변

2

그것은 모든 사용자 지정 작업에서 올바른 "오류 코드가"반환에 관하여이다. 설치를 종료하려면 CA에서 ActionResult.Failure을 반환하십시오.

사이드 노트 : 사용자 지정 동작 내부에서 UI를 표시하는 것은 일반적으로 좋지 않습니다.이 시나리오에서는 자동 설치를 지원하지 않습니다.

+0

ActionResult.Failure를 시도해도 마침 버튼 대신 다음 버튼이 계속 표시됩니다. 가능한 해결 방법은 무엇입니까? – reapen

+0

ActionResult가 실패한 경우 Install UI 시퀀스를 수행해야합니다. Installed 이전에 "CA_CheckList"가 없습니다. reapen

+0

당신의 질문을 이해하십시오. 커스텀 액션으로부터'ActionResult.Failure'를 돌려 주면 (자), 일반적으로 인스톨이 롤백 (rollback)됩니다. 사용중인 UI에 따라 최종 "설정 실패"대화 상자가 표시되거나 표시되지 않습니다. AFAIK, 전체 UI 구성표에는 시나리오에 필요한 모든 대화 상자가 포함되어 있습니다. –

3

이것은 오래된 게시물이지만 다른 사람이이 사실을 발견 한 경우 질문에 답변하고 싶습니다. 사용자 지정 동작 정의에서 CustomAction Id = "CA_CheckList"BinaryKey = "BIN_CustomAction"..., 'Return'은 'ignore'로 설정됩니다. '확인'으로 설정해야합니다.

관련 문제