I have a problem with the xbCulture components when it comes to uninstalling them.

 The xbPeople component is required for any of the other components to work, it also has some minimal functionality of its own but would not normally be installed alone.

When installing xbBooks, xbFilms and xbLive are packaged with xbPeople. This works fine - installing, say, the xbBooks package when xbFilms is already installed simply updates xbPeople but doesn't affect any data or options.

The install scripts need to be arranged so that xbPeople installs first so that the other component can install correctly.

However when uninstalling there is a problem. Uninstalling either of the packages will uninstall xbPeople component leaving the other package's component as an orphan and not working correctly. This happens irrespective of whether blockChildUninstall is enabled in the package xml files.

During package uninstall the package script runs first, then xbPeople then the other component, so the package script can detect the presence of the other component and abort the uninstall. This means that you need to allow the user to uninstall the components individually so you can't use blockChildUninstall.

So now I need to detect when uninstalling xbPeople whether either of the other components are still present and abort the process if they are - however I only want to do this if it is not a package uninstall. This is because if only, say, xbBooks package is installed then when it runs the xbPeople uninstall routine the xbBooks component will still be there and xbPeople uninstall will abort.

I can do this by setting a session variable when the package uninstall runs and detecting that during xbPeople uninstall to decide which component to check before aborting the uninstall.

Finally if the uninstall is aborted I want to exit gracefully to somewhere more useful to the user than the default template error page - the dashboard for the relevant component.