Apologies if the logic implied seems dumb.. i'm new to this..

I have an application that we currently hand over to a third party to install on their environment, we have several non-default options (i'll mention these later) and we're providing a step-by-step guide as to how this app should be installed...but it invaribly ends with mistakes...

It is my hope that I can script the entire process....But i'm quite confused as to how to best achieve this, perhaps someone can give me advice?

First step is to uninstall the previous app..
-Plenty of wsadmin scripts out there to let me do this...

Next step is to install the app...
-Plenty of scripts to install a simple app... BUT..
I need to set the class loader paths to PARENT_LAST in a couple of locations
I need to check the 'deploy web services' option
I need to specify a jndi name for a datasource
and lastly
I'd like to pre-compile the jsp's.

I'm aware of Enhanced EAR files, I know that I can set the classloader paths inside the enhanced EAR... But What is the best way to do the rest?

ideally i'd like to produce a script 'install_my_app.sh' which will uninstall the old app and then put the new one in, sync the nodes etc...

Is there anyone who can give me some advice or provide me with an example of how to do this? I've seen example 'install scripts' which dont go into this much detail, and i've seen very simple deployment.xml's that set the classloader modes... But I'm not yet 100% on the xmi:id's.. is there a specific list of these?

I realise thats quite a few questions i've presented.. but thanks for having a read.