Insert custom action between dialogs (InstallUISequence) in WiX

I have two custom dialog boxes (plus the required ExitDlg , FatalErrorDlg , etc.), the first sets the property using the Edit control, and the second shows this property using the text control. Here is the meaningful code:

 <Dialog Id="DialogA" ...> <Control Id="ControlEdit" Type="Edit" Property="MY_PROPERTY" .../> <Control Id="ControlNext" Type="PushButton" ...> <Publish Event="EndDialog" Value="Return" /></Control> </Dialog> 

And then the second dialog box:

 <Dialog Id="DialogB" ...> <Control Id="ControlText" Type="Text" Text="[MY_PROPERTY]" .../> <Control Id="ControlBack" Type="PushButton" ...> <Publish Event="EndDialog" Value="Return" /></Control> <Control Id="ControlNext" Type="PushButton" ...> <Publish Event="EndDialog" Value="Return" /></Control> </Dialog> 

And the sequence of actions:

 <InstallUISequence> <Show Dialog="DialogA" Before="MyCustomAction" /> <Custom Action="MyCustomAction" Before="DialogB" /> <Show Dialog="DialogB" Before="ExecuteAction" /> </InstallUISequence> 

A custom action changes the value of MY_PROPERTY . My problem is how to make the back button in DialogB go back to DialogA . Using NewDialog is simple, but then I can not get a custom action to be executed between dialogs, or can I?


change - 2013-05-02

After answering from @caveman_dick, I tried to change DialogA almost as he said, but instead of using EndDialog I changed to Action="NewDialog" Value="DialogB" . But now the custom action is not called. If I remove the Publish event to go to the next dialog, the CA is called. If I stay as @caveman_dick, I cannot return to DialogA from DialogB .


change - 2013-05-02

After searching the WiX 3.6 book: Windows XML Installer Developer's Guide, I found the following: β€œIf you have more than one publishing event, they must have conditional expressions as their inner text. Otherwise, all events simply will not be published.”

So, the answer from @caveman_dick is correct, except that you need to change to the following:

 <Publish ...>1</Publish> 
+6
source share
1 answer

Instead of scheduling a custom action in InstallUISequence you can publish it on a button:

 <Dialog Id="DialogA" ...> <Control Id="ControlEdit" Type="Edit" Property="MY_PROPERTY" .../> <Control Id="ControlNext" Type="PushButton" ...> <Publish Event="DoAction" Value="MyCustomAction">1</Publish> <Publish Event="EndDialog" Value="Return">1</Publish> </Control> </Dialog> 

EDIT: The Publish element condition must explicitly evaluate true to run, so add "1" as the text for the Publish elements.

+8
source

Source: https://habr.com/ru/post/944113/


All Articles