[wix-users] Extracting temporary helper binaries for data driven custom actions and clean up

Edwin Castro egcastr at gmail.com
Fri Dec 4 14:23:38 PST 2015


I'm planning a class of data driven custom actions that will require to
extract binaries from the Binary table to use in the execute and rollback
actions. Those binaries will need to be deleted from the target system when
the installation completes successfully or after rollback.

The way I'm handling this right now is to extract the binary streams from
the Binary table in the schedule action and write them to the execute
custom action data *AND* rollback custom action data BEFORE any other
per-item data. In this approach the execute and rollback actions are
responsible for writing the helper binaries to disk and clean up after
themselves.

I initially used the approach because it got me to a working state quicker.
Now I have an opportunity to clean up the custom actions but I'm not sure
how to proceed. Currently I'm considering using commit actions to help
clean up after myself but I don't fully understand how they work or how
they are intended to be used.

My current plan:

1. Schedule action extracts binaries from Binary table and writes them to
disk at a temporary location.
2. Schedule action writes paths to temporary locations to execute and
rollback custom action data.
3. Execute action reads temporary paths and uses helper binaries but does
NOT delete the files yet (even on failure)!
4. Rollback action can use helper binaries on failure because the execute
action did not delete the files.
5. Rollback action is responsible for deleting helper binaries.
6. Commit action is responsible for deleting helper binaries after
successful completion???

Does this approach even make sense?

When should commit actions be scheduled in relation to other custom actions?

Does the commit action execute even after a rollback? Does this imply that
I can do all clean up in the commit action regardless of whether we rolled
back or not?

Am I missing something fundamental about commit actions that would change
the way I'm thinking about this plan?

-- 
Edwin G. Castro


More information about the wix-users mailing list