Susumu Arai
Susumu Arai

Reputation: 309

Wix3: Overridable attribute of <Show> element is ignored?

I'm using Wix3.11 and trying to customize the ExitDialog. The source code of the dialog (ExitDialog.wxs in wix3-wix31rtm.zip) schedules this dialog with the following statement:

<Show Dialog="ExitDialog" OnExit="success" Overridable="yes" />

So, I copied this file to my local directory as MyExitDialog.wxs, rename the Dialog Id from ExitDialog to MyExitDialog and scheduled this dialog with:

<Show Dialog="MyExitDialog" OnExit="success" />

But, when I ran light, I got the following error:

MyExitDialog.wxs(37): error LGHT1050: The AdminUISequence table contains actions 'MyExitDialog' and 'ExitDialog' which both have the same sequence number -1.  Please change the sequence number for one of these actions to avoid an ICE warning.
C:\build\work\eca3d12b\wix3\src\ext\UIExtension\wixlib\ExitDialog.wxs(29): error LGHT1051: The location of the action related to previous warning.

I was expecting MyExitDialog's show element overrides the original ExitDialog's show element, but it's not working that way.

Am I misunderstanding how the Overridable attribute works? Or, am I looking at the wrong ExitDialog.wxs file?

Upvotes: 0

Views: 120

Answers (1)

Brian Sutherland
Brian Sutherland

Reputation: 4798

You're including something like

<UIRef Id="WixUI_Minimal"/>

in your install. You need to find the related UI file (here) and copy the contents of that file into a new wxs in your wix project. You can name this "MyUI" or something and also update the Id in the <UI Id="..."> tag from "WixUI_Minimal" to something else (for example).

In the new file you just created, update that one line

<Show Dialog="ExitDialog" OnExit="success" Overridable="yes" />

to

<Show Dialog="MyExitDialog" OnExit="success" />

Now in your <Product> update that <UIRef> to reference your new UI.

The WixUIExtension contains a wixlib with all the definitions of the UI and Dialogs. You just defined a new exit dialog in your project but the old one still exists and is defined in the WixUIExtension dll. Since you were still using the old UIRef it was bringing in everything along with your one dialog that was defined. This caused the double definition of actions with sequence -1.

The overridable tag has this text

If "yes", the sequencing of this dialog may be overridden by sequencing elsewhere.

That means you can redefine the sequencing of the dialog:

<Show Dialog="ExitDialog" Sequence="55" Overridable="yes"/> 
(or Before="..." or After="..." or OnExit="...")

and not get any redefinition errors since it was marked overridable.

The root problem is that you can't have two <Show> tags both with OnExit="success"

Upvotes: 1

Related Questions