Implementing program license on instalation/deinstalation (1 license per computer)

  anti-piracy, installation, licensing, windows

I wanted to ask if there is a efficient way of licensing a program, so that it can be installed only on one pc (through code of course), with internet connection required only on instalation and deinstalation. I’d like to make the program unable to run via copying files from the first computer that the program has been installed on.

I was thinking about adding computers mac into a database, and hiding it somewhere in a random library (to check upon running, if it’s the authorized pc [without internet connection]), so that upon Instalation I could check my database if you can install this program on your pc.

Do you guys have better ideas? Or improvments to my?
Thank you in advance

Source: StackOverflow