4
votes

How can I make a call to my Custom Action dll when I click on Next button? Currently what I am doing is given below:

<CustomAction Id="TestingAction" BinaryKey="BIN_CustomAction" DllEntry="TestValue" Execute="deferred" Return="check" />
<Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Default="yes" Text="&amp;Next"></Control>
<Custom Action="TestingAction" After="Next"></Custom> 

When I given After ="Next" which is my Next button i am getting error after building my application.

Unresolved reference to symbol 'WixAction:InstallUISequence/Next' in section 'Product:*.

How to resolve is issue and can anyone help me how to make a call to CustomAction after i click on Next Button.

1

1 Answers

9
votes

What you are trying to do is to schedule the deferred custom action to a certain sequence and run it after a custom action called Next, which obviously doesn't exist. You should go a totally different way to call custom action on button click.

Follow the steps below:

  • create a custom action. It must be immediate (execute='immediate') and should never ever change the state of the target system
  • author a Control element - the button you'd like to trigger the event
  • finally, author a Publish element as a child of the Control, which publishes the DoAction event

Here's a full sample from the WiX sources how to print EULA on a button click:

<Control Id="Print" Type="PushButton" X="88" Y="243" Width="56" Height="17" Text="!(loc.WixUIPrint)">
  <Publish Event="DoAction" Value="WixUIPrintEula">1</Publish>
</Control>

Obviously, the Control element should be a child of Dialog element. And the custom action is defined like this:

<CustomAction Id="WixUIPrintEula" BinaryKey="WixUIWixca" DllEntry="PrintEula" Return="ignore" Execute="immediate" />

Hope this helps.