MSDN's overview is here: http://msdn.microsoft.com/library/aa368036.aspx

A control can both publish (send out) and subscribe to (receive from others)
events. However, not all controls can do both, and what they can do varies
by control, by event, and by whether they are reporting or listening.
Further, you can publish to an event OR a property.

Publishing a property means that when the control would have fired that
event, some property is set to the event's value.
Publishing an event means "shouting out: Hey, xyz(abc) just happened!" where
xyz is the event name and abc is the event value.
Subscribing to an event hooks some control's attribute to an event, such
that when that event is published, that control's attribute will be set to
the event's value.

Some events have built-in listeners, others don't. All of the documented
defined events are listed on this page:
http://msdn.microsoft.com/library/aa368043.aspx

Since I don't use internal UI all that much, I forgot you can't call
MsiProcessMessage from a custom action called via DoAction from an event.
So, the only thing you can do with your custom action is change properties.

Properties used for conditions are only evaluated when the dialog is first
populated, so the only way to "refresh" the dialog is to replace the dialog
with itself (assuming that can be done, which I don't honestly know). You
would have to use the same event that calls your custom action with a later
order value so that the activity that subscribes to that event runs after
your custom action has completed.

The event mapping is "set", so typically what happens is you get the
following kind of model:

You can use some event from some control to fire your CA, which evaluates
and sets a property.
That same event can then trigger a pop-up dialog based on your property if
you are reporting an error condition, which returns to your dialog when the
user acknowledges it and tries again.
That same event can move to another dialog based on another state of your
property, for example, you passed validation.

The above model is a type of PID validation sample I remember from the SDK a
while back, but I am having trouble finding just where I found it before.
When/if I find it, I will show what the markup looks like to implement it. I
know it isn't just like what you are looking for, but we have said before
that the internal UI is quite limited. There are a whole other set of
limitations on the external and embedded UIs, but we don't live in a perfect
world, apparently.

-----Original Message-----
From: Dan Giambalvo [mailto:danie...@microsoft.com] 
Sent: Thursday, October 22, 2009 4:07 PM
To: General discussion for Windows Installer XML toolset.
Subject: Re: [WiX-users] Using a CustomAction to modify a dialog

I'm sorry, I'm having trouble wrapping my head around how this subscribe
model works, and also difficulty figuring out how to fire the appropriate
events from within the CustomAction (currently in VBScript.)  Can you
possibly offer a small bit of XML to demonstrate your thinking? 

-----Original Message-----
From: Blair [mailto:os...@live.com] 
Sent: Thursday, October 22, 2009 3:10 PM
To: 'General discussion for Windows Installer XML toolset.'
Subject: Re: [WiX-users] Using a CustomAction to modify a dialog

I've never tried this, but if the text control subscribes to the actiondata
event, could your custom action send an actiondata event to it?

Let us know how that works.

-----Original Message-----
From: Dan Giambalvo [mailto:danie...@microsoft.com] 
Sent: Thursday, October 22, 2009 2:56 PM
To: wix-users@lists.sourceforge.net
Subject: [WiX-users] Using a CustomAction to modify a dialog

I'm trying to use a CustomAction to do some evaluation, and modify an
on-screen Windows Installer dialog.  The scenario is this:

1)      User enters some text in an edit control

2)      User clicks a button which invokes a custom action to evaluate the
entered text

3)      Custom action completes, and some new text is shown to the user *in
the same dialog*

I've envisioned two ways of building this:

1)      (ideal) Some Text Control lives on the dialog with Text= some
property.  The CustomAction modifies the property value, and the text
control displays the new value.

2)      I create a text control for each possible string I want to show all
overlapping.  The CustomAction either hides/shows the appropriate control,
or sets some property which triggers a bunch of show/hide Conditions on each
text control.

The problem I'm running into is that I can't seem to get Windows Installer
to re-evaluate any properties after the custom action ends.  For example, I
have a button that runs my custom action and it changes the property, but
the UI doesn't update. If I spawn a dialog however (by hitting cancel for
example) then the UI updates.

Does anyone know of a clever way to tickle Windows Installer into
re-evaluating properties after the CustomAction ends?

Thanks
-Dan
----------------------------------------------------------------------------
--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


----------------------------------------------------------------------------
--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


----------------------------------------------------------------------------
--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to