As mentioned before I have implemented a "Custom Actions" feature in the 
extended BA. The name custom action is probably wrong but couldn't think of a 
better name at the time, "User Functions" might be better – open to suggestions.

The idea behind these is that they allow you to simply hook in to the BA 
without having to write your own BA. The functions are currently called at 4 
places, OnDetect, OnDetectComplete, OnPlan and OnPlanComplete. The function are 
written in C++ and there is a fairly simple template for the library. The 
functions have access to the a lot of the standard WiX libraries including the 
BA function e.g. Logging and reading/setting variables.

Uses for the OnDetect function would be setting up variables that would be too 
complex to be handled by the standard Variable and RegRegistry elements. 
Examples:

  1.  I needed to scan a number of registry keys that were setup by an 
application and set a variable that could be used to block the install.
  2.  Read some values from the registry and run some complex logic to set 
another value (if val1 and val2 and not val3).
  3.  Detect a system setting that is not part of the standard variables (e.g. 
Number of cores came up recently).
  4.  Read the current state of the installed application to ensure upgrade or 
repair use the same values.

Uses for OnPlan would be mainly to apply logic to values read during detect. 
For example my implementation of radio buttons sets a value for each button, an 
OnPlan function could merge these into one value (if RadioButton1 then 
RadioButton=1 else if RadioButton2 then RadioButton=2).

I don't have specific use for the "complete" functions but I can see that could 
be useful to do similar functions but at a later stage in the process.

What they are definitely not for is changing state but I guess there is no way 
to stop someone doing that.

Does anyone think this would make a useful addition to the standard BA?

Neil

Neil Sleightholm
X2 Systems Limited
n...@x2systems.com
------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
WiX-devs mailing list
WiX-devs@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-devs

Reply via email to