Depends on how sophisticated.
Desaware.com has a licensing system that is pretty nice and can do this and
activation if you like. It takes a while to get it working just right,
because that and activation and the various scenarios are inherently
complex, but it works great.