It's main a procedural thingThe first thing is to tell the customer what to expect before they purchase. What are the rules and process for this type of thing. Get them to agree to your terms as part of the sale process.
The second thing is to keep good records of who has purchased.
Then, third, you can issue replacements to those who bought previously, subject to your terms or discretion. It is at this point you can consider automation - for example, allowing previous customers to log-in to a download area at your web site.
Be aware that you can not automate 100% no matter how good your system. Dealing with customers and their questions is just something you have to do if you want to be in business!