Subscribing to control events
Some events can't be published, only listened for. In that case, you'll use a
Subscribe
element inside a Control
element. Like we did when publishing an event, use its Event
attribute to specify the event to listen for, but this time use Attribute
to set the required argument.
The next example shows a ProgressBar
control that subscribes to the SetProgress
event. Whenever a standard or custom action notifies the installer that progress has been made, the ProgressBar
control will know about it and add more ticks:
<Control Id="MyProgressBar" Type="ProgressBar" X="50" Y="50" Width="200" Height="20" ProgressBlocks="yes"> <Subscribe Event="SetProgress" Attribute="Progress" /> </Control>
Unlike the Publish
element, the Subscribe ...
Get WiX 3.6: A Developer's Guide to Windows Installer XML now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.