PDA

View Full Version : Avoiding Rollback On Abort



shjones99
01-16-2009, 03:07 PM
My InstallScript MSI project performs an action in OnMoving that, if OnAbort is called, I don't want to rollback. Is that possible? If so, how?

Here's what I'm trying to accomplish: My package is updating an existing installation (i.e., updating a bunch of files in the INSTALLDIR). In case of problems, I want to be able to restore the INSTALLDIR to its original status. So, in OnMoving, I'm copying the entire contents of INSTALLDIR to SRCDIR. Then, if the program aborts, I've added code to OnAbort to copy back the original contents of INSTALLDIR. As long as everything goes OK in OnAbort, this works fine. However, if something goes wrong in OnAbort, and the copying doesn't go smoothly, I want the backup copy to still be available (so the user can manually copy back the files). Trouble is, it isn't -- it gets deleted by the normal InstallShield rollback process (because I create the backup in OnMoving).

Can anyone offer a suggestion as to how to solve this Catch-22?

Thank you!