For removal, people sometimes take the deferred action that was marked as
the rollback install action and double mark it as their remove deferred
action, which then lets you take your installation deferred action and
double mark it as your remove rollback action (confused, yet?).

The idea being that since remove is the opposite of install, and the
rollback does the opposite of whatever transaction you were running, then
you write the minimal amount of custom action code to make it all work
(which is only two deferred routines in your CA dll).

To keep your own sanity and make sure that repairs, etc. don't mess things
up, it is best to do what the built-in standard actions effectively do and
have an immediate CA or two (the only one(s) you ever then explicitly
schedule in the InstallExecuteSequence table) that generate your custom
action data for you and "schedule" your deferred action and rollback actions
by calling MsiDoAction() only as needed based on component/feature install
states and/or properties they examine, along with possibly checking the
system to see if the action has already been performed.

During the "scheduling" phase of the transaction, the immediate actions that
are encountered in the sequence table are run, and the deferred (whether
just deferred or are rollback also) are written to their respective scripts
(along with the associated properties that become their CustomActionData).
Finally any scheduled Commit actions written to the script are processed
(after rollback is no longer a possibility).

One of these days someone is going to write what I just wrote into code in a
form that will allow others to copy it/use it. I hope I get to it in the
next couple of months...

-----Original Message-----
From: Richard [mailto:legal...@xmission.com] 
Sent: Tuesday, November 10, 2009 4:27 PM
To: wix-users@lists.sourceforge.net
Subject: Re: [WiX-users] Rollback and uninstall sequences...


In article <2ca537e10911101230v21ed97e1sabffc232fc58b...@mail.gmail.com>,
    Tony <yellowjacketl...@gmail.com>  writes:

> During rollback, all actions executed since the InstallInitialize are
> run again in reverse order (assuming conditions are met), correct?
> And the Rollback property is set.  Are actions after InstallFinalize
> called (assuming conditions are met) at the end of a rollback?

The install transaction includes all the actions between
InstallInitialize and InstallFinalize.  While executing the actions
in the install transaction, any rollback actions that are enountered
are written to a rollback script.  If an action in the install
transaction fails, then the actions in the rollback script are
executed in reverse order.

So, a rollback doesn't execute *any* action in the install transaction
in reverse order, it executes rollback actions.  Standard actions have
rollback support automatically (they write actions into the rollback
script when executed), so two actions don't appear in the transaction
(an installation action and a rollback action), but for custom actions
its a different story.

Only deferred custom actions can participate in the install transaction.
However, a rollback custom action has additional flags in the custom
action in-script execution options.  So you'll typically have two custom
actions to support rollback: the deferred action that modifies the system
and the rollback custom action that undoes the modifications.

Therefore, to support rollback scenarios in a custom action you need
to sequence two actions and the rollback custom action must be
sequenced before the deferred action that modifies the system.  If you
don't observe this sequencing constraint, then your rollback custom
action won't execute when your deferred action fails.  If your
rollback action is sequenced after your deferred action, it won't have
been written into the rollback script when your deferred action fails
and the changes made by the deferred action won't be undone.
-- 
"The Direct3D Graphics Pipeline" -- DirectX 9 draft available for download
 <http://legalizeadulthood.wordpress.com/the-direct3d-graphics-pipeline/>

      Legalize Adulthood! <http://legalizeadulthood.wordpress.com>

----------------------------------------------------------------------------
--
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus
on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users

Reply via email to