How to make Windows System Restore ignore some of my application files?

1.4k views Asked by At

I am experimenting with software copy protection ideas and now I have the following problem.

I have a trial version of my application. Trial data are stored in a certain file and also in some certain registry keys. Of course I know that user can break this trial protection by using some registry and file monitoring and backup tools but I want at least protect against some simple hacks like date-time changes and using Windows System Restore.

The problem is that Windows System Restore wipes out all my application files and also the trial data. I know that System Restore does not affect User's documents folder but I not want to store the trial datafile there, because it is too obvious.

Is there any way I can stop System Restore to remove my trial data file?

2

There are 2 answers

3
Ralf de Kleine On BEST ANSWER

Why not store it in the user's doc application folder?

  • Encrypt the content in the file
  • When the file is gone, trial is over

Application folder

http://msdn.microsoft.com/en-us/library/bb425869.aspx

Security through obscurity

http://en.wikipedia.org/wiki/Security_through_obscurity

Other option is the use of the application settings

Best practice to save application settings in a Windows Forms Application

0
jbriggs On

I know this is old but since the selected answer doesn't answer the question asked I figured I'd add my answer for anyone else that ends up here.

To make System Restore ignore files add a REG_MULTI_SZ registry value to the following key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\BackupRestore\FilesNotToBackup

Environment variable and wild can be used. To include subdirectories add " /s" to the end. For example to add everything in c:\temp using reg.exe from the command line

reg add HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\BackupRestore\FilesNotToBackup /v Temp /t REG_MULTI_SZ /d "c:\temp\* /s"