views:

57

answers:

2

I have developed software and am trying to protect it from being copied from one machine to another by writing all of the machine MAC addresses to a text file in the root apps folder for the program on the first run of the app. Everytime the app is run thereafter it checks to see if the text file is there and compares data in the text file to the mac addresses on the computer it is being run on. If they are differant the program fails to run.

If someone tried to just copy the directory they would also copy the text file and when they tried to run the app on another computer it would fail.

It is not a problem to write something to the virtual store but the program can then be copied and run on a unauthorized machine.

I need to write one text file one time.

Thanks, Myles

+1  A: 

With UAC enabled you can't do that without the user's permission. Write data files to the user's app data folder instead...

KristoferA - Huagati.com
What I have found is; Most eveyone, not all, will copy the entire app directory since they do not know if they need the txt file or not. I would be fairly tough to figure out what was causing the app not to run. The txt file is currently written to the virtual store user app data wher UAC are inforced. I do not want to disable UAC. I need a one time write for the Vista/W7 systems.
myles
myles
+1  A: 

You got only one shot at this, which is all you need. The setup.exe program for your app will run with admin privileges. Write a custom action to get that file created.

I'll avoid talking about the merits of security through obscurity. Or the enormous trouble you'll get into when an important client suddenly can't use mission critical software anymore because of a hardware upgrade.

Hans Passant
In general when you live in a UAC world take all the things you used to do "on first run" and do them on install. The install is elevated, the first run isn't. Like Hans I will withhold comment on the merits of your overall plan.
Kate Gregory