As per @Alex k Comment
you can't write CD/DVD with self remove or auto erase because its read only media
but you need to implement login in your application and check date/year using your application .
But if if user change his system DateTime then your application may cracked :)
so, best way to create serial no. and validate with your web/remote system .
- Generate yourself a secret key for the product
- Take the user's name
- Concatentate the users name and the secret key and hash with (for example) SHA1
- Unpack the SHA1 hash as an alphanumeric string. This is the individual user's "Product Key"
- Within the program, do the same hash, and compare with the product key online. If equal, OK.