If you boot into recovery mode on an old laptop and see the message, “An Error occurred while preparing the installation. Try running this application again,” chances are that Apple is rejecting the request from your computer because the battery has died and the time is reset. Open up terminal from the utilities menu and type date and hit enter. If it says 2001, you need to set the date to the current date. You can set it with date HHMMmmddYYYY, such as 130107092014 for 1:01 PM, July 9 2014. After that, quit terminal and try reinstalling again.

Via https://discussions.apple.com/thread/5467959?start=15&tstart=0