Reputation: 952
I have completed making my c# application deployed it using the setup project. When the application is installed it created files and folders in "Program Files"(or any user selected) folder.
The problem is regarding the security of this application. If someone copies the installed folder and then runs the application on his machine it runs fine. The application should only run if it has been installed on the PC using the setup file. But even copying the installed files to a new PC and then running the "exe" causes the application to execute.
I want to prevent this from happening. Any help on this subject will be really appreciated. I know there are many ways to achieve this, please point out a few.
Upvotes: 3
Views: 2422
Reputation: 5836
You may want to machine-lock your application, so that it runs only one a specific machine. This is typically achieved by using machine-locked or activated licenses.
Take a look at CryptoLicensing which provides this functionality.
DISCLAIMER: I work for LogicNP Software, the developer of CryptoLicensing.
Upvotes: 0
Reputation: 11396
Running the setup will already leave a key in the registry, just as all other applications do. There's no need to create additional keys.
Iterate through the installed applications looking for yours, and if it's not there inform the user to run the setup.
You should do that looking at the registry information. Here's a nice implementation that will return if it is not installed, installed just for the user, or for everyone:
http://mdb-blog.blogspot.com.ar/2010/12/c-check-if-app-is-installed-for-all.html
NOTE: This is not the way to implement copy protection, it's just to verify that your setup process was run accordingly.
Upvotes: 0
Reputation: 1295
Okay. Listen carefully!
When you install using setup project, add an assembly in cutsom action which will create registery entry in the regedit.
and include the initial lines in your project code which checks the registery, if it finds registery it further continues the operation and if not, it will display an error message that please install the application. this will definitely work;.
Upvotes: 3