There is something called Copyright Law which already protects you from this. In general, if people are willing to break the law, they will probably also be willing to break whatever mechanism you put in place to prevent them from breaking the law.
If you want someone to be able to run your program, you have to give them the program. There is no way around that. You can employ any amount of obfuscation, indirection, encryption, and protection you want, ultimately, you have to give them all the keys so that they can run the software. And in order to run the software, the CPU has to understand the software. CPUs are much stupider than people, so if a CPU can understand the software, then people can, too, and they can reverse engineer and remove whatever mechanisms you put in place.
There is only one way to make this work: don't give them the software. Run it yourself, and only give them access to it. Note: a variation of this, is to give them a sealed box with the software on it to run themselves. But even this is tricky, this is e.g. what gaming console manufacturers (try to) do, and pretty much all of them have been broken.
Or, the alternative: don't do business with criminals. Establish a culture of trust and honesty between you and your customers, not fear and paranoia.