Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

What is final event in an abort?


15 replies to this topic

BFealy

BFealy
  • Full Members
  • 35 posts

Posted 27 June 2012 - 17:01

I'm working with an InstallScript project in IS v12.0.

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

MSIYER

MSIYER
  • Full Members
  • 90 posts

Posted 28 June 2012 - 12:56

Just check where you abort the installer.
The abort statement does not rollback if called after the OnFirstUIAfter event.

Edited by MSIYER, 28 June 2012 - 13:11.


BFealy

BFealy
  • Full Members
  • 35 posts

Posted 28 June 2012 - 13:23

The abort is being called somewhere during the move data events (during the installing/installed for each feature, etc.)...
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.

Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 28 June 2012 - 15:46

I haven't explored aborting an active uninstall much, but I'm surprised to hear that those feature uninstall events are still being called after the OnAbort() routine ends.

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.
user posted image

BFealy

BFealy
  • Full Members
  • 35 posts

Posted 28 June 2012 - 16:17

Taco,

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.

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 28 June 2012 - 16:21

I would expect OnEnd to be the very last event. After that, InstallShield cleans up the support files.

MSIYER

MSIYER
  • Full Members
  • 90 posts

Posted 29 June 2012 - 08:30

@Stefan
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.


Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 29 June 2012 - 13:28

According to the documentation, OnEnd() is indeed skipped in the event of an abort operation MSIYER.

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.
user posted image

BFealy

BFealy
  • Full Members
  • 35 posts

Posted 29 June 2012 - 14:21

Thanks very much Taco, MSIYER, and Stefan.

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

BFealy

BFealy
  • Full Members
  • 35 posts

Posted 29 June 2012 - 19:18

No dice on the "OnMoved" handler... it doesn't appear to be called during an abort.

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

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

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.
Sorry for the confusion. I didn't remember this, and the 2012 documentation doesn't mention this (I don't have version 12 at hand).



BFealy

BFealy
  • Full Members
  • 35 posts

Posted 09 July 2012 - 13:55

Still stuck, unfortunately. The RunOnce got voted down, as it would require a reboot.

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

Taco Bell

Taco Bell

    IS6 Expert

  • Moderators
  • 1,281 posts

Posted 11 July 2012 - 12:34

In that case, it sounds like you may need a custom EXE wrapper that invokes the IS setup and then monitors the results in order to cleanup after itself.
user posted image

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 11 July 2012 - 16:45

If you know the file names (and they'll be always the same) you can put dummies with that names in the Support Files section of InstallShield. Then InstallShield should do the clean up work.

BFealy

BFealy
  • Full Members
  • 35 posts

Posted 11 July 2012 - 20:00

@Stefan:
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

BFealy

BFealy
  • Full Members
  • 35 posts

Posted 19 July 2012 - 14:31

No dice so far on the temp file fix, looks like putting placeholders in isn't going to solve the problem sad.gif

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: