You accept the philosophy of setting only if the flag is NOT there, which means you need to leave the flag after deletion. It also fails when the user finds the flag and removes it himself.
It is better if you expand it and only allow the program to work if there is a flag there. This flag will be a registration key that has an expiration date for its encryption. When the program expires or is deleted, you remove the flag.
I implement this by forcing my users to visit my site to register and receive a free trial key. There may be other ways, but I like it because it also allows me to collect information about who is trying my program.
source
share