How do I customise the Wix Progress Dialog?

2019-04-09 18:48发布

问题:

I'm trying to customise the standard WiX Progress Dialog (I want to make it show the ActionData). I've followed Neil's guide to customising dialogs but the trouble is, the original ProgressDlg is still being shown instead of mine.

I think I know why: if you look at the source to ProgressDlg you can see this block of code:

   <InstallUISequence>
    <Show Dialog="ProgressDlg" Before="ExecuteAction" />
  </InstallUISequence>

So rather than being published by another dialog, as most dialogs are, it is being triggered directly as part of the InstallUISequence. So how do I override this?

回答1:

It seems that the progress dialog must be the last thing in the InstallUISequence before ExecuteAction - otherwise, because Progress Dialogs are modeless, it is shown then hidden straight away.

My solution therefore is just to make sure that my custom progress dialog is shown after the existing one:

  <InstallUISequence>
    <Show Dialog="CustomProgressDlg" After="ProgressDlg" />
  </InstallUISequence>


回答2:

@Samuel, it is working as Bob said: "As long as you don't reference ProgressDlg" but this statement is not precise. You need to find all references to ProgressDlg, but find them in the WiX sources. Then you need to create your own version of any dialog which references the ProgressDlg and is included by your setup (direct or indirect use of it!), in order to make it also reference your customized dialog.

I have tried this to solve the same issue. For using eg. the FeatureTree UI Sequence you would have to create your own versions of the following dialogs in addition to the ProgressDlg:

  • MaintenanceWelcomeDlg
  • ResumeDlg
  • WelcomeDlg

This is because they define a Show element which is referencing ProgressDlg.



回答3:

ProgressDlg is scheduled only when you refer to it. If you want to replace it, customize your dialog sequence to not refer to ProgressDlg.



回答4:

@Klaus, fortunately you don't have to re-create your own versions of the dialog with v3.11.1. In the InstallUISequence, you can override the dialog sequence e.g.

<Show Dialog="WelcomeDlg" Before="ProgressDlgCustom">NOT Installed OR PATCH</Show>

Make sure you omit the Show/@override - this was the exact condition from the WelcomeDlg.



标签: wix wix3.5