1

I am looking for way to refresh current page after custom action.

My code

<Control Id="Config" Type="PushButton" .../>
    <Publish Event="DoAction" Value="SetConfiguration"></Publish>
</Control>

It can be after custom action, but I don't see that Session has such an opportunity, or just adding some Event to Control that will work.

Edit:

Ok I have somethink like this:

<Control Id="Config" Type="PushButton" X="120" Y="243" Width="56" Height="17" Default="yes" Text="Config" >
   <Publish Event="DoAction" Value="SetConfiguration" Order="1"></Publish>
   <Condition Action="disable">EndConfig = "true"</Condition>
   <Condition Action="enable">EndConfig = "false"</Condition>
   <Publish Event="NewDialog" Value="IISconfiguration2">EndConfig="true</Publish>
</Control>

But how to create NewDialog after return result custom acion. Because it now do it in this same time. Set order on 1 and 2 dont work.

Mat Rat
  • 105
  • 1
  • 11

2 Answers2

3

Try this

<Control Id="Config" Type="PushButton" X="120" Y="243" Width="56" Height="17" Default="yes" Text="Config" >
    <Publish Event="DoAction" Value="SetConfiguration">1</Publish>
    <Condition Action="disable">EndConfig = "true"</Condition>
    <Condition Action="enable">EndConfig = "false"</Condition>
    <Publish Event="NewDialog" Value="IISconfiguration2">2</Publish>
</Control>
Silny ToJa
  • 1,815
  • 1
  • 6
  • 20
2

This is a known behavior in MSI native UI.

The best work around I have is to make a clone of the dialog and transition from the original to the clone dialog (or the clone to the original) so that it looks like the same dialog to the user but it's actually a different dialog and the data will be refreshed.

Example.

On SQLDlg1:

  <Control Id="Test" Type="PushButton" Text="&amp;Test" TabSkip="no" Default="yes" Height="17" Width="56" X="283" Y="195">
      <Publish Event="NewDialog" Value="SQLDlg2">1</Publish>
      <Publish Event="DoAction" Value="ValidateDatabase">1</Publish>
    </Control>

On SQLDlg2:

<Control Id="Test" Type="PushButton" Text="&amp;Test" TabSkip="no" Default="yes" Height="17" Width="56" X="283" Y="195">
      <Publish Event="NewDialog" Value="SQLDlg1">1</Publish>
      <Publish Event="DoAction" Value="ValidateDatabase">1</Publish>
    </Control>

On the next dialog I also clear the property in case they click back.

<Publish Dialog="VerifyReadyDlg" Control="Back" Property="DatabaseValid" Value="{}">1</Publish>
  <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="SQLDlg">1</Publish>
Christopher Painter
  • 54,556
  • 6
  • 63
  • 100
  • Adding [Stefan Kruger's sample for this](http://www.installsite.org/pages/en/msi/articles/MultiListBox/index.htm). And here is a [WiX demo of dialog changes](https://github.com/glytzhkof/all/tree/master/WiXCustomDialog) ([zipped version](https://github.com/glytzhkof/all/blob/master/WiXCustomDialog.zip)). Alternatively make a GUI using [Burn - the setup bootstrapper](https://stackoverflow.com/a/52349744/129130) for full dialog events. Finally a link to [a custom bootstrapper application sample](https://bryanpjohnston.com/2012/09/28/custom-wix-managed-bootstrapper-application/comment-page-1/). – Stein Åsmul May 26 '20 at 15:23
  • @SteinÅsmul I dont do it for bootstrapper. I change specific configuration things in custom action, assigns results to property and change the value of the button to enable / disable. And the changes only become visible when I return to the previous card and restart the current card. – Mat Rat May 27 '20 at 09:02
  • I was trying add additional dialog, but my custom action take longer than the transition to the next card is in progress, which means that the data is refreshed only later and no changes are visible. Is it possible to set some sleep? or wait, e.g. some property value will be true? – Mat Rat May 27 '20 at 09:07
  • 1
    Can you move the action to application launch? Generally much better and easier to deal with coding and testing-wise. – Stein Åsmul May 27 '20 at 11:32
  • My real world example of this is a dialog with a database [TEST] connection button. Clicking the button causes a control event to fire a custom action that updates a property that is on the dialog. After that custom action completes another control event transitions me to the duplicate dialog that then shows the result. Testing again does the same thing but now I'm taken to the first dialog. – Christopher Painter May 27 '20 at 13:10
  • @SteinÅsmul I have to display to the user what I am doing and what the result of the action is, because it is possible that an error will occur and the user must know what was unsuccessful and carry out this configuration fragment manually. In addition, I have blocked the Next button and I would like to unlock it only after configuration and this requires refreshing the page. – Mat Rat May 29 '20 at 09:20
  • @ChristopherPainter And are you able to show how you do it, that it create the copy of this page after the end of the action. My connected in this way what I presented the action and assigned "go to next dialog" for button config does not wait for the action to finish. – Mat Rat May 29 '20 at 09:27
  • I gave a small example. Consulting services are available if you need assistance in creating a complete solution. – Christopher Painter May 29 '20 at 13:24