I have made a windows Form application in c#. Now I want to make a windows installer package for the same application with license key input. Once license key has been entered and validated it should be saved in the windows registry.
Also I have unique requirement of using the license key only once. Once the software has been successfully installed automatically license key and the package should be expired so that in future if the client want to reinstall it he has to contact back.
Basically a serial number validation is performed using a custom action included in the package. However, if the custom action just validates the number it cannot limit the serial number usage, i.e. the serial number can be shared by multiple users.
To have it with limited usage you can use a server-side validation, i.e. have the custom action connect to a web server, check the serial number against a DB from that server, and in that DB you can also check if that serial number was already activated or not.
In Advanced Installer user guide you can find a server-side serial number validation sample, now sure what installer tool you are currently using.
NOTE, server side validation imposes that all your users will have an active internet connection during the installation process.