It sounds like you're trying to distribute a web application. You might be interested in reading this: Installation System Design for a Large Apache/mod_perl Application. The design described there is being used, with some modifications, in Krang. So far it's worked very well for us.