2017-02-20 55 views
0

我已經添加到安裝WiX的安裝使用自定義對話框:ProgramDataInstallDlg維克斯自定義對話框錯誤2856

這就是我的UI標籤的樣子對整個項目:

<UI Id="my_UI"> 
    <UIRef Id="WixUI_FeatureTree" /> 
    <DialogRef Id="ProgramDataInstallDlg" /> 

    <Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog" Value="ProgramDataInstallDlg">1</Publish> 
    <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="ProgramDataInstallDlg">1</Publish> 
</UI> 

如果只按下下一項,一切正常。但是如果在VerifyReadyDlg中按下後退按鈕或按下CustomizeDlg中的下一個按鈕。我得到錯誤2856

這是安裝日誌說:

DEBUG: Error 2856: Creating a second copy of the dialog ProgramDataInstallDlg 
The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2856. The arguments are: ProgramDataInstallDlg, , 
MSI (c) (E0:6C) [14:06:34:526]: Product: MOPS 4.0 -- The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is 2856. The arguments are: ProgramDataInstallDlg, , 

的哪些錯誤?

編輯ProgramDataInstallDlg:

<?xml version="1.0" encoding="UTF-8"?> 
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> 
    <Fragment> 
    <UI>  
     <Dialog Id="ProgramDataInstallDlg" Width="370" Height="270" Title="[ProductName] Setup" NoMinimize="yes"> 

      <!--Banner UI-components--> 
      <Control Id="Title" Type="Text" X="15" Y="6" Width="200" Height="15" Transparent="yes" NoPrefix="yes" Text="Custom Setup" /> 
      <Control Id="Description" Type="Text" X="25" Y="23" Width="280" Height="15" Transparent="yes" NoPrefix="yes" Text="text" /> 
      <Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="!(loc.InstallDirDlgBannerBitmap)" /> 
      <Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" /> 

      <!--Content Components--> 

      <Control Id="NameLabel" Type="Text" X="45" Y="73" Width="220" Height="15" TabSkip="no" Text="text" />  


      <!--Bottom UI-components--> 
      <Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" /> 
      <Control Id="Back" Type="PushButton" X="173" Y="243" Width="56" Height="17" Text="Back"> 
      <Publish Event="SpawnDialog" Value="CustomizeDlg">1</Publish> 
      </Control>   
      <Control Id="Next" Type="PushButton" X="230" Y="243" Width="56" Height="17" Default="yes" Text="Next"> 
      <Publish Event="SpawnDialog" Value="VerifyReadyDlg">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> 
     </UI> 
    </Fragment> 
</Wix> 

回答

1

如果您自定義UI,我建議創建一個自定義WixUI_FeatureTree。

看看下面的代碼。我採用了默認模板,並在適當的地方使用了對話框名稱。

從您的自定義對話框中刪除以下行:

<Publish Event="SpawnDialog" Value="VerifyReadyDlg">1</Publish> 
<Publish Event="SpawnDialog" Value="CustomizeDlg">1</Publish> 

主對話框

<?xml version="1.0" encoding="UTF-8"?> 
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> 
    <Fragment> 
     <UI Id="WixUI_FeatureTreeCustom"> 
      <TextStyle Id="WixUI_Font_Normal" FaceName="Tahoma" Size="8" /> 
      <TextStyle Id="WixUI_Font_Bigger" FaceName="Tahoma" Size="12" /> 
      <TextStyle Id="WixUI_Font_Title" FaceName="Tahoma" Size="9" Bold="yes" /> 

      <Property Id="DefaultUIFont" Value="WixUI_Font_Normal" /> 
      <Property Id="WixUI_Mode" Value="FeatureTree" /> 

      <DialogRef Id="ErrorDlg" /> 
      <DialogRef Id="FatalError" /> 
      <DialogRef Id="FilesInUse" /> 
      <DialogRef Id="MsiRMFilesInUse" /> 
      <DialogRef Id="PrepareDlg" /> 
      <DialogRef Id="ProgressDlg" /> 
      <DialogRef Id="ResumeDlg" /> 
      <DialogRef Id="UserExit" /> 
      <DialogRef Id="ProgramDataInstallDlg" /> 

      <Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">1</Publish> 

      <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="LicenseAgreementDlg">NOT Installed</Publish> 
      <Publish Dialog="WelcomeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">Installed AND PATCH</Publish> 

      <Publish Dialog="LicenseAgreementDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg">1</Publish> 
      <Publish Dialog="LicenseAgreementDlg" Control="Next" Event="NewDialog" Value="CustomizeDlg">LicenseAccepted = "1"</Publish> 

      <Publish Dialog="CustomizeDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="1">Installed</Publish> 
      <Publish Dialog="CustomizeDlg" Control="Back" Event="NewDialog" Value="LicenseAgreementDlg" Order="2">NOT Installed</Publish> 
      <Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog" Value="ProgramDataInstallDlg">1</Publish> 

      <Publish Dialog="ProgramDataInstallDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg">1</Publish> 
      <Publish Dialog="ProgramDataInstallDlg" Control="Back" Event="NewDialog" Value="CustomizeDlg">1</Publish> 

      <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="ProgramDataInstallDlg" Order="1">NOT Installed OR WixUI_InstallMode = "Change"</Publish> 
      <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="2">Installed AND NOT PATCH</Publish> 
      <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="3">Installed AND PATCH</Publish> 

      <Publish Dialog="MaintenanceWelcomeDlg" Control="Next" Event="NewDialog" Value="MaintenanceTypeDlg">1</Publish> 

      <Publish Dialog="MaintenanceTypeDlg" Control="ChangeButton" Event="NewDialog" Value="CustomizeDlg">1</Publish> 
      <Publish Dialog="MaintenanceTypeDlg" Control="RepairButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish> 
      <Publish Dialog="MaintenanceTypeDlg" Control="RemoveButton" Event="NewDialog" Value="VerifyReadyDlg">1</Publish> 
      <Publish Dialog="MaintenanceTypeDlg" Control="Back" Event="NewDialog" Value="MaintenanceWelcomeDlg">1</Publish> 
     </UI> 

     <UIRef Id="WixUI_Common" /> 
    </Fragment> 
</Wix> 
+0

爲什麼會WixUI_FeatureTree更好? –

+0

獲取相同的錯誤。 –

+0

請添加自定義對話框ProgramDataInstallDlg。 –