Standard actions and deferred custom actions scheduled between
InstallInitialize and InstallFinalize do not execute immediately. Instead,
the necessary information to perform their tasks is written to a script. The
information needed to roll back the tasks (including rollback custom
actions) is written to a rollback script. When the InstallFinalize action is
executed, the scripts are passed to the Windows Installer service which
executes the tasks on the client application's behalf.
If any errors occur during execution of the install script, Windows
Installer aborts the installation and runs the rollback script to undo the
operations that were done.
If something custom that you do needs to be undone on a failure, you must
schedule a rollback custom between InstallInitialize and InstallFinalize.
IIRC, the rollback script is executed in reverse order - typically you
schedule your rollback actions just before their corresponding deferred
install actions.
If everything in the install script executes successfully, the service runs
any commit actions. Only then does control return to the client process and
the execute sequence for any actions appearing after InstallFinalize.
The section of the execute sequence between InstallInitialize and
InstallFinalize is often referred to as 'the transaction'.
--
Mike Dimmick
_____
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Rory Clark
Sent: 21 July 2007 02:41
To: wix-users@lists.sourceforge.net
Subject: [WiX-users] Clarification question about rollbacks...
I've been reading through Phil Wilson's The
<http://www.amazon.com/Definitive-Guide-Windows-Installer-Experts/dp/1590592
972/ref=sr_1_3/102-0932021-5185723?ie=UTF8&s=books&qid=1184976274&sr=8-3>
Definitive Guild to the Wndows Installer. I got the distinct impression,
though I can't find it now, that rollbacks cannot happen during the Install
Finalize action, let alone after Install Finalize. Various experiments would
back this up even. I can, and I currently am, returning an error code that
causes the MSIExec to stop and return an exit code after Install Finalize.
MSI (s) (5C:F8) [17:56:00:272]: Note: 1: 1708
MSI (s) (5C:F8) [17:56:00:272]: Note: 1: 2205 2: 3: Error
MSI (s) (5C:F8) [17:56:00:272]: Note: 1: 2228 2: 3: Error 4: SELECT
`Message` FROM `Error` WHERE `Error` = 1708
MSI (s) (5C:F8) [17:56:00:272]: Note: 1: 2205 2: 3: Error
MSI (s) (5C:F8) [17:56:00:272]: Note: 1: 2228 2: 3: Error 4: SELECT
`Message` FROM `Error` WHERE `Error` = 1709
MSI (s) (5C:F8) [17:56:00:272]: Product: _Cobrand clickserver_1.0.0.0
Installer -- Installation failed.
MSI (s) (5C:F8) [17:56:00:272]: Cleaning up uninstalled install packages, if
any exist
MSI (s) (5C:F8) [17:56:00:272]: MainEngineThread is returning 1603
MSI (s) (5C:6C) [17:56:00:292]: Destroying RemoteAPI object.
MSI (s) (5C:04) [17:56:00:292]: Custom Action Manager thread ending.
=== Logging stopped: 7/20/2007 17:56:00 ===
MSI (c) (DC:E8) [17:56:00:302]: Decrementing counter to disable shutdown. If
counter >= 0, shutdown will be denied. Counter after decrement: -1
MSI (c) (DC:E8) [17:56:00:302]: MainEngineThread is returning 1603
=== Verbose logging stopped: 7/20/2007 17:56:00 ===
But the action doesn't roll back.
<InstallExecuteSequence>
<Custom Action="schedConfigMods.action" After="CostFinalize" />
<Custom Action="findIceFramework.action" After="InstallValidate" />
<Custom Action="rollbackConfigMods.action"
Before="execConfigMods.action" />
<Custom Action="execConfigMods.action" After="InstallFiles" />
<Custom Action="generateConfigurations.action" After="Install
Finalize" />
</InstallExecuteSequence>
This action needs to run after the files have been written to disk and after
the "execConfigMods.action", but I don't seem to have that granular of
control. If I set the After attribute to "execConfigMods.action", the
"generateConfigurations.action" runs before the files are written to the
disc and the install exits without error. Right now, I want the install to
fail and roll back, but it is defying me.
If I look at the log, all of the files actually get written to the disc
during Install Finalize and the first file copy doesn't happen until 23
lines into the action.
Thanks!
Rory
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
WiX-users mailing list
WiX-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wix-users