It would be complicated to automate since there's not really a documented list of dependencies that I know of. A different approach may be to create a stream-lined installer. This site may be of interest:http://www.nliteos.com/nlite.html
If you hunt around you can find forums with custom scripts and help configuring them to your liking. I believe it depends on your particular set up if you can create a complete installer just from the files on your system partition. Some OEMs put all the system files you need and some don't.
But check forums for particulars. I did it once just to strip out games to make an installer for a Virtual Machine. If you don't try to strip out too much stuff then it's not too difficult to get a working installer that's lean. If you get too ambitious removing things you can end up with an install that doesn't function. I'd recommend against trying to remove Internet Explorer from the install. Too many things expect it to be there including the OS installer.
You may find it easier just to let it install, then remove it later. Of course if you are an avid IE user then it's moot.