How about using wp-cli to download and install wordpress, it gives more flexibility http://wp-cli.org/