3

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.

Sunny
  • 932
  • 8
  • 22

3 Answers3

3

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;.

SHAKIR SHABBIR
  • 1,295
  • 1
  • 14
  • 25
  • 2
    Not foolproof though, as somebody can export/import the registry entry. Unless the entry is somehow hashed against the particular machine. – Michael Paulukonis Jun 23 '12 at 20:17
  • I know it is not foolproof...but the client was happy with this level of security. I am still trying to make the application more secure. – Sunny Aug 22 '12 at 21:01
0

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.

Pablo Romeo
  • 11,298
  • 2
  • 30
  • 58
0

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.

logicnp
  • 5,796
  • 1
  • 28
  • 32