What is final event in an abort?
Posted 27 June 2012 - 17:01
I've got an OnAbort action which is cleaning up supportdir. Problem is, it appears OnAbort executes before the features have uninstalled, and the uninstalling handlers for my features need something in supportdir.
So what I'm looking for is, what is the absolute final event in an abort or uninstall, so I can clean up supportdir only after the uninstalling/uninstalled feature handlers have completed using the contents of supportdir?
thanks,
Brian
Posted 28 June 2012 - 12:56
The abort statement does not rollback if called after the OnFirstUIAfter event.
Edited by MSIYER, 28 June 2012 - 13:11.
Posted 28 June 2012 - 13:23
So what I'm having problems with is that if Feature X and Feature Y have been installed, then Feature Z's installation fails and OnAbort is triggered/called, the OnAbort handler contains the code which cleans out the SUPPORTDIR.
Then after the OnAbort routine ends, the uninstalling/uninstalled events for Feature X and Feature Y are called. But those events depend upon a script that was in SUPPORTDIR, which is now empty.
So it appears there are 2 options I have right now... either
1) Don't clean up SUPPORTDIR in OnAbort, thus allowing Features X and Y to uinstall themselves cleanly, but leaving behind the full contents of SUPPORTDIR after the failed install
OR
2) Clean up SUPPORTDIR fully, but Features X and Y will not uninstall cleanly, as they required the script in SUPPORTDIR which is gone before they got uninstalled.
My hope was that there was a handler or someplace in the process that would give me a third option that allows both cleaning up SUPPORTDIR AND allowing Features X and Y to remove themselves completely and cleanly.
Posted 28 June 2012 - 15:46
Given what you've said though, my suggestion would be a third approach. It being that during uninstall you register a RunOnce registry entry to automatically clean up the SUPPORTDIR content on the next reboot. Especially for the case where the uninstall is aborted. However, if your uninstall does complete, then conditionally during either the OnMoved() or the OnEnd() events you immediately clean up the SUPPORTDIR content and remove the previously queued RunOnce entry.
Posted 28 June 2012 - 16:17
Sorry if I wasn't clear.. the abort is happening during an Install.
In the course of our installation, there is a potential that one (or more) of our features will encounter a situation where it cannot complete installation and the abort event is triggered.
The OnEnd event indicates it isn't called on an abort, so that would be useful to cleanup the SUPPORTDIR during a completed installation, but not during the scenario I'm particularly targetting now.
The OnMoved seems interesting, however... does that event get called once all files are removed and their feature-specific "Uninstalling" and "Uninstalled" event handlers are completed? And during an install, are "Installing" and "Installed" completed for all features prior to OnMoved being called?
Thanks for the information.
Posted 28 June 2012 - 16:21
Stefan Krüger
InstallSite.org twitter facebook
Posted 29 June 2012 - 08:30
I believe only OnAbort gets called when the installation is aborted. OnEnd is not called in this case.
An EXIT statement makes a call to OnEnd. All other methods of uninstall too call OnEnd.
@BFealy
I think, OnAbort is the only event triggered when ABORT keyword is used.
So all cleanup will happen there. The most important thing is OnAbort actually uninstalls the features.
Edited by MSIYER, 29 June 2012 - 08:33.
Posted 29 June 2012 - 13:28
Also, thank for the clarification BFealy on your actual scenario as that helps explain what's happening here, but I believe you overlooked that I had a two-fold approach. The first being to queue the RunOnce cleanup in the event that the installation is aborted.
However, as Stefan indicated, InstallShield should be automatically cleaning up after itself and removing the support files.
As for the OnMoved event, you're correct that it should be called only once after all files are installed/removed depending on the context.
Posted 29 June 2012 - 14:21
I'll give all of the options a try, I had a feeling that OnAbort should have been doing the correct thing, but in the course of testing it hasn't been.
I will give the OnMoved handler a shot and try to set up an IF that detects when the installer is in an aborted state, as I think that would be the most likely way to solve the problem I'm having.
The RunOnce key is something I'll keep in my back pocket as well, our restrictions on operations we can perform on our client machines are somewhat tight, but it may come down to that, it would certainly clean up properly.
Thanks again,
Brian
Posted 29 June 2012 - 19:18
I also think I've figured out why the supportdir isn't cleaning up, some of our code is adding files there and not cleaning up after itself, so the automatic cleanup is unable to remove the folder at the end.
There are also apparently some additional actions we're performing using those supportdir contents, so I need to figure out what's happening.
Going to have to pitch the RunOnce option, but I think the reboot requirement may kill that one.
Ideally, I'd like something like OnEnd that runs during an Abort. (I've tried moving the cleanup to the very last call in OnAbort, but it appears the Uninstalling/Uninstalled handlers fire after that in the log.)
Thank you all for your help.
Brian
Posted 02 July 2012 - 09:19
QUOTE |
I believe only OnAbort gets called when the installation is aborted. OnEnd is not called in this case. |
Stefan Krüger
InstallSite.org twitter facebook
Posted 09 July 2012 - 13:55
We've neatened up a bunch of the droppings in the support folder, in hopes of being able to eliminate the explicit delete of SUPPORTDIR, but still haven't solved the underlying issue of the uninstalling/uninstalled handlers running after the OnAbort.
Thanks for all of your suggestions, I'll keep plugging at it and see if there's something that would work.
Brian
Posted 11 July 2012 - 12:34
Posted 11 July 2012 - 16:45
Stefan Krüger
InstallSite.org twitter facebook
Posted 11 July 2012 - 20:00
Thanks for the idea, I'll have to see how the tools work on creating the intermediates, if they can overwrite 0k placeholder files, that'd be a good way to work around the issue.
@Taco Bell:
That's heavy duty but not a bad alternative if it comes down to it, since reboots are ruled out. Thanks!
Brian
Posted 19 July 2012 - 14:31
I've got a log snippet below which shows the behavior I'm seeing... basically the Abort handler runs, which calls out to removeregentries, then Abort ends, followed by the SERVER feature and several others running after the ABORT handler has ended (as seen by the "Closed and Copied" line, which is the final event in the ABORT handler code)
I'm now down to hoping that the COMMONLIBRARIES feature is the final one in the sequence always, as I may need to put things in there to clean up.
[964] ::: INSTALL LOG ::: Displaying cancel dialog...
[964] ::: INSTALL LOG ::: Installation cancelled.
[964] ::: INSTALL LOG ::: ABORT: Executing
[964] ::: INSTALL LOG ::: REMOVEREGENTRIES:
[964] ::: INSTALL LOG ::: REMOVEREGENTRIES:
[964] ::: INSTALL LOG ::: REMOVEREGENTRIES:
[964] ::: INSTALL LOG ::: REMOVEREGENTRIES:
[964] ::: INSTALL LOG ::: REMOVEREGENTRIES:
[964] ::: INSTALL LOG ::: ABORT: Installation aborted.
[964] ::: INSTALL LOG ::: ******* Installation Log END *******
[964] ::: INSTALL LOG ::: Closed and Copied.
[964] ::: INSTALL LOG ::: SERVER:
[964] ::: INSTALL LOG ::: FEATURE1: Starting removal of installation.
[964] ::: INSTALL LOG ::: FEATURE1:
[964] ::: INSTALL LOG ::: FEATURE1:
[964] ::: INSTALL LOG ::: FEATURE1:
[964] ::: INSTALL LOG ::: FEATURE1:
[964] ::: INSTALL LOG ::: FEATURE1:
[964] ::: INSTALL LOG ::: FEATURE1:
[964] ::: INSTALL LOG ::: FEATURE1:
[964] ::: INSTALL LOG ::: FEATURE2:
[964] ::: INSTALL LOG ::: OPERATION1:
[964] ::: INSTALL LOG ::: OPERATION1:
[964] ::: INSTALL LOG ::: OPERATION1:
[964] ::: INSTALL LOG ::: FEATURE3:
[964] ::: INSTALL LOG ::: FEATURE3:
[964] ::: INSTALL LOG ::: COMMONLIBRARIES:
[964] ::: INSTALL LOG ::: COMMONLIBRARIES: