Any security system can be broken, and the more elaborate you make the security system, the more it's going to irritate people and motivate them to go somewhere else. Probably the best solution is unlock codes that only work during a certain time period (check key against hash for current day and 6 preceding days) or can only be used once (software connects to your database over the internet to verify the key, then "uses" it), but the former can be fooled by changing your computer time, and the latter requires an active internet connection, something which may or may not be available depending on the type of program you're making.
Optionally, you can offer a bare-bones version of your program for free, then charge for installation and/or additional features.