Question: how pirated software is detected?
Answer: There is no way to tell whether software is pirated on a technical level, simply because there are many ways to pirate software (registration key generators, patches, etc.). You could prevent people installing any software at all using a technical solution, which is what I'd suggest.