Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,


I am making an application in Visual Studio 2017 (VB.NET) and I want to write a code that prevents the executable file from being copied.

I did see a solution online that stated to mention the serial number of the HDD of the system and that will prevent the application from being installed in other systems.


I am making this application for a company with over 80 machines, so this idea does not seem appropriate. Instead, if I could possibly write down a bunch of codes, say for example if the .exe file encounters with "Ctrl+C" command then it will show an error or something like that. Hope you understand.


Please help.

What I have tried:

I have not tried anything as of now.
Posted
Updated 11-Apr-18 20:34pm

There's no simply way to secure your application from being copied, used, etc. You'll never be sure that your application is not used, no matter of how many ways you used to protect it.

The base idea is very similar to well known solutions: each copy of your application need to get specific serial number (SN). Then, you have to create installer which will:
1) demand user from entering SN
2) connect to your database and check if that SN is already in use
3) depending on result in 2) allow/disallow further installation process.

Note: during the installation process, you have to write an information (hidden to user), for example SN, that an application has been installed properly. If SN does not exists, executable won't run. See: Where should I store my data?[^]
 
Share this answer
 
v3
Comments
Wendelius 12-Apr-18 22:35pm    
Nicely explained!
Maciej Los 12-Apr-18 23:58pm    
Thank you, Mika.
Short version: You can’t (Well not easily and not worth the time)

A possible solution could be to have a 'home base' server which the client software can communicate with and check if it is a valid install/license. If not, the software could disable itself or if the install is valid, continue as normal for the end user.

This could allow you to monitor active installs, revoke as well as all kinds of goodness

-DB
 
Share this answer
 
Quote:
How do I prevent my VB.NET output (.exe) file from being copied?

Short answer: you don't. You can't prevent the exe from being copied or installed on another PC.
All you can do is prevent the exe from doing something useful if it don't find a license file matched with something physical from the PC.
Quote:
I did see a solution online that stated to mention the serial number of the HDD of the system and that will prevent the application from being installed in other systems.

It don't prevent from installation, it prevent usage on another PC.
Quote:
so this idea does not seem appropriate.

It is the only way.

Basically, your app starts like that:
if license file not exist then
  ask for a valid license file
  stop app
endif
read license file
if not license file then
  ask for a valid license file
  stop app
endif
if license don't match then
  ask for a valid license file
  stop app
endif
// license checked
do stuff
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900