President Camacho
President Camacho

Reputation: 1900

Wix custom dialog error 2856

I've a wix installation with a custom dialog added into the installation: ProgramDataInstallDlg

This is what my UI-tag look like for the whole project:

<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>

Everything works fine if only next is pressed. But if back button is pressed in VerifyReadyDlg or next button in CustomizeDlg is pressed. I get error 2856.

This is what the installation log says:

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, , 

Whats wrong?

EDIT 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>

Upvotes: 0

Views: 1849

Answers (1)

Arkady Sitnitsky
Arkady Sitnitsky

Reputation: 1886

If you are customizing the UI I suggest to create a custom WixUI_FeatureTree.

Take a look at the code below. I took the default template and used your dialog name in the appropriate places.

From your custom dialog remove the following lines:

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

The main dialog:

<?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>

Upvotes: 1

Related Questions