Question

i want to create a custom dialog, scheduled before the welcome dialog. The custom dialog has a bitmap-control, some text-controls and two buttons for cancel (SpawnDialog->CancelDlg) and next (NewDialog->WelcomeDlg). No fancy custom actions or setting properties.

  • Wix Version: 3.8
  • Using WixUI_InstallDir.wxs

I already found the following question: How can I insert custom dialog before WelcomeDlg? Although its marked as answered, the questioner gets the same error messages (see comments) as me using the solution of that answer. So please dont mark this one as a duplicate.

The following code (from customDialog.wxs, with dialogRef in WixUi_InstallDir.wxs) does build, and the custom dialog shows up as the first dialog, ...

<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
 <Fragment>
  <UI>
   <Dialog Id="CustomDlg" Width="370" Height="270" Title="[ProductName] - Setup">
    <Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="!(loc.WixUINext)">
      <Publish Event="NewDialog" Value="WelcomeDlg">1</Publish>
    </Control>
    <Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="!(loc.WixUIBack)" Disabled="yes"/>
    <Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)">
      <Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>
    </Control>         
    <!-- ... More Controls ... -->
   </Dialog>

   <InstallUISequence>
     <Show Dialog="CustomDlg" After="CostFinalize">NOT Installed OR PATCH</Show>
   </InstallUISequence>
  </UI>
 </Fragment>
</Wix>

...but the UI-sequence is totally messed up:

customDlg -> welcomeDlg -> verifyDlg -> welcomeDlg -> verifyDlg -> progressDlg ...

So clicking the "install"-button causes a jump back to the welcome dialog. In the second "turn", clicking the install-button has the desired effect of triggering the installation :-P

I tried scheduling my custom dialog in different places by either @Before, @After or @Sequence (i use Orca to have a look at the UISequence) and even build my own WelcomeDlg (as described here: http://neilsleightholm.blogspot.de/2008/08/customised-uis-for-wix.html). I messed around with the InstallUISequence-Element in the WelcomeDlg, like scheduling it after the custom dialog. But (surprise surprise) @After="CustomDlg" has the same effect as @Before="WelcomeDlg" in the custom dialog, messing up the UI-sequence again.

I thought about the User Account Control causing that mess, but what should the UAC do to step back in the ui-sequence of the MSI? Makes no sense to me. Anyway i tried running the MSI over admin-Cmd what should suppress any prompt of UAC when hitting the install-button. But still the same messed up UI-sequence.

Thanks in advance for any help.

Was it helpful?

Solution

Typically only 1 dialog (welcomeDlg) has an entry in the InstallUISequence table. All other dialogs are brought in by NewDialog ControlEvents. What you have done is add a new dialog and scheduled it in the UI sequence before welcomeDlg. You then put a NewDialog event linking the two.

When you get to verifyDlg it calls and EndDialog control event that transfers control back to the InstallUISequence. The InstallUISequence then finds the entry point for welcomeDlg and the process repeats itself.

You should remove the relationship between the custom dialog and the welcome dialog and replace it with an EndDialog control event. Note that this means it's not possible to go "back" from welcome to the first custom dialog.

If you need the custom dialog to be the first dialog, you have a lot of work ahead of you. I would suggest that the first dialog should always be welcome so it's not a good exercise.

The only time I ever sequence additional dialogs up front is when I do a replacement for Launch Conditions. In this case I don't expect the installer to continue so that's fine. Welcome never gets called.

OTHER TIPS

First solution You can add entry to your new custom dialog into the InstallUISequence table and turn off standard welcome dialog.

Second solution Download sources located on SourceForge, copy and add some dialog set to you project and replace all what are you want.

More details you can find on my blogue Replacing a standard WelcomeDlg with a custom one

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top