PC Review


Reply
Thread Tools Rate Thread

How to stop user from deleting/modifying our application's files?

 
 
=?Utf-8?B?SGFyaQ==?=
Guest
Posts: n/a
 
      27th Dec 2004
hi,

my pocket pc application generates some output files and it also make use of
some configurable input files(both text files). After starting my program,
if any user deletes my input files/output files, my application will not work
smoothly and anything unexpected can happen.

it may be similar to complaining to Microsoft that Windows is not working
properly, after deleting the entire Windows system directory?

Still, I search for an answer. How can we stop the user from deleting or
modifying all our application's files. Or how to deny access to our
application's folder?

I wish t know, how all other developers have tackled this situation?

Regards,
hari
 
Reply With Quote
 
 
 
 
Daniel Moth
Guest
Posts: n/a
 
      27th Dec 2004
Generally speaking, I'd treat that scenario the same as if a user deleted
your exe. How will your app work then? In any case, you should have default
values for anything you read from a file, registry or wherever. At startup,
try to obtain the input and when it fails your code falls back to the
hardcoded default(s).

Cheers
Daniel
--
http://www.danielmoth.com/Blog/


"Hari" <(E-Mail Removed)> wrote in message
news3EB382D-6B45-4D5A-AFE8-(E-Mail Removed)...
> hi,
>
> my pocket pc application generates some output files and it also make use
> of
> some configurable input files(both text files). After starting my
> program,
> if any user deletes my input files/output files, my application will not
> work
> smoothly and anything unexpected can happen.
>
> it may be similar to complaining to Microsoft that Windows is not working
> properly, after deleting the entire Windows system directory?
>
> Still, I search for an answer. How can we stop the user from deleting or
> modifying all our application's files. Or how to deny access to our
> application's folder?
>
> I wish t know, how all other developers have tackled this situation?
>
> Regards,
> hari



 
Reply With Quote
 
=?Utf-8?B?SGFyaQ==?=
Guest
Posts: n/a
 
      27th Dec 2004
Whenever Mr.Daniel is there, we, developers are confident.

Could you please elaborate on denying access to particular folders/files?

"Daniel Moth" wrote:

> Generally speaking, I'd treat that scenario the same as if a user deleted
> your exe. How will your app work then? In any case, you should have default
> values for anything you read from a file, registry or wherever. At startup,
> try to obtain the input and when it fails your code falls back to the
> hardcoded default(s).
>
> Cheers
> Daniel
> --
> http://www.danielmoth.com/Blog/
>
>
> "Hari" <(E-Mail Removed)> wrote in message
> news3EB382D-6B45-4D5A-AFE8-(E-Mail Removed)...
> > hi,
> >
> > my pocket pc application generates some output files and it also make use
> > of
> > some configurable input files(both text files). After starting my
> > program,
> > if any user deletes my input files/output files, my application will not
> > work
> > smoothly and anything unexpected can happen.
> >
> > it may be similar to complaining to Microsoft that Windows is not working
> > properly, after deleting the entire Windows system directory?
> >
> > Still, I search for an answer. How can we stop the user from deleting or
> > modifying all our application's files. Or how to deny access to our
> > application's folder?
> >
> > I wish t know, how all other developers have tackled this situation?
> >
> > Regards,
> > hari

>
>
>

 
Reply With Quote
 
Daniel Moth
Guest
Posts: n/a
 
      27th Dec 2004
Sorry Hari, it seems my previous post was not clear. My suggestion is not to
worry about users deleting your files. If they do, fallback to hardcoded
defaults in your application so you don't rely on the input files being
there.

Now if you really need to cater for that scenario, here are some random
suggestions (I've never had to do that myself):

1. Mark the files as ReadOnly. If you need to change that setting when your
app is running, change it and then change it back when your app exits. Look
up System.IO.FileAttributes.ReadOnly for this.
2. Mark the files as system files or as Hidden (same as 1,
System.IO.FileAttributes.Hidden)
3. Instead of using files, use the registry as your store which is harder
for the user to mess with.
4. And a more radical approach, embed the input files in the assembly. On
startup check to see if the files are on the system and if they are not,
extract them from your assembly and use them. This was discussed recently in
a different context but the principle is the same (look at Alex Feinman's
contribution):
http://groups-beta.google.com/group/...28bba550894d45

Cheers
Daniel
--
http://www.danielmoth.com/Blog/


"Hari" <(E-Mail Removed)> wrote in message
news:9DAAA3C5-D98F-4140-B78C-(E-Mail Removed)...
> Whenever Mr.Daniel is there, we, developers are confident.
>
> Could you please elaborate on denying access to particular folders/files?
>
> "Daniel Moth" wrote:
>
>> Generally speaking, I'd treat that scenario the same as if a user deleted
>> your exe. How will your app work then? In any case, you should have
>> default
>> values for anything you read from a file, registry or wherever. At
>> startup,
>> try to obtain the input and when it fails your code falls back to the
>> hardcoded default(s).
>>
>> Cheers
>> Daniel
>> --
>> http://www.danielmoth.com/Blog/
>>
>>
>> "Hari" <(E-Mail Removed)> wrote in message
>> news3EB382D-6B45-4D5A-AFE8-(E-Mail Removed)...
>> > hi,
>> >
>> > my pocket pc application generates some output files and it also make
>> > use
>> > of
>> > some configurable input files(both text files). After starting my
>> > program,
>> > if any user deletes my input files/output files, my application will
>> > not
>> > work
>> > smoothly and anything unexpected can happen.
>> >
>> > it may be similar to complaining to Microsoft that Windows is not
>> > working
>> > properly, after deleting the entire Windows system directory?
>> >
>> > Still, I search for an answer. How can we stop the user from deleting
>> > or
>> > modifying all our application's files. Or how to deny access to our
>> > application's folder?
>> >
>> > I wish t know, how all other developers have tackled this situation?
>> >
>> > Regards,
>> > hari

>>
>>
>>





 
Reply With Quote
 
Frederik Jensen
Guest
Posts: n/a
 
      28th Dec 2004
"Daniel Moth" <(E-Mail Removed)> wrote in message
news:%(E-Mail Removed)...
> Sorry Hari, it seems my previous post was not clear. My suggestion is not
> to worry about users deleting your files. If they do, fallback to
> hardcoded defaults in your application so you don't rely on the input
> files being there.

[Cut]

Good point. One of the big issues on the pocket pc is to ensure that your
application always work. One way to do this is to try to cut the users off
from modifying the device settings, manipulating files and
removing/installing additional application. Where there is a will there is a
way and the most "devious" will find a way.

My approach is to use default settings (inifile + registry) where none
exist; auto install my application at start up if not installed; autorun a
full screen application at startup (if installed); saving basic files in a
flash folder; finally I consider to Flash my install application into ROM.

Creating an enviroment for an end user application that will always work is
a task in its own.

--
Frederik Jensen, Judex


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Modifying application folder structure results in application restart- How to stop? IUnknown Microsoft ASP .NET 5 3rd Jun 2008 08:57 PM
Re: Modifying application folder structure results in applicationrestart - How to stop? Joe Microsoft ASP .NET 0 3rd Jun 2008 06:39 AM
Problem with Vista deleting, modifying files on an XP drive robert.clere@snet.net Windows Vista General Discussion 1 13th Sep 2007 03:38 AM
deleting files left after deleting user accounts =?Utf-8?B?ZGViemVl?= Windows XP General 5 29th Sep 2006 09:03 AM
stop user from deleting email in oulook 2002 jtg2 Microsoft Outlook 1 29th Apr 2006 04:41 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 08:44 PM.