Search code examples
c#securitywebinstallationactivation-codes

how to protect my C# program from being installed on different systems unauthorized


I am a bit new to C# program language, I will like to know how to secure my C# desktop app from being redristibuted on various systems without my permission. I have seen some possible solutions but I will want your advice

  • Create a web activation system where a pin/unique code is issued before every install
  • Create an online install system that allows people to install directly from a website without downloading the setup

Please help advice on the best option to take(I'll love to use the first option if it is possible with php/mysql because I am not good with asp.net)


Solution

  • Well you can't instal a program without a setup file. You need some small setup file that would download the actual setup file from your setup, that is how I see most programs being installed.

    Normally on a server you have options to download full setup file (big setup file that contains all the installation data) and online setup file (small file that requires internet connection during installation).

    And it doesn't really mater do you use php or asp.net on your server, because the only thing that matters is what your script does on the server.

    How your validation would work is that your setup file before installing your program would require the user to insert the validation key and it would send it to the server. Your php script will search the mysql table and if it finds that key it would tell your setup file that password is ok and it would mark that key as "used" in your mysql table. Otherwise the user would have to reenter the key.