Home > Archive > VC Language > January 2006 > Protecting Files and Folders
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Protecting Files and Folders
|
|
| Sandeep 2006-01-30, 8:02 am |
| I have a windows application ( VC++, COM) which we distribute through
an Installer. I want to ensure that nobody can delete any of the files
under our install directory manually. Only legal way would be to
un-install the application. I was wondering how can I get a lock on a
top level folder so that nothing can be deleted from it. Any thoughts ?
Thanks
Sandeep
| |
| Igor Tandetnik 2006-01-30, 8:02 am |
| "Sandeep" <sandeepsinghal@gmail.com> wrote in message
news:1138629065.237714.33970@f14g2000cwb.googlegroups.com
> I have a windows application ( VC++, COM) which we distribute through
> an Installer. I want to ensure that nobody can delete any of the files
> under our install directory manually. Only legal way would be to
> un-install the application.
You can't. An administrator has full control over the system. If what
you describe were possible, it would be an open invitation to every
virus and trojan writer.
If you are bent on doing this, google for "Sony rootkit" for some ideas
(and legal ramifications).
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
| |
| Sandeep 2006-01-30, 7:07 pm |
|
Igor Tandetnik wrote:
> "Sandeep" <sandeepsinghal@gmail.com> wrote in message
> news:1138629065.237714.33970@f14g2000cwb.googlegroups.com
>
> You can't. An administrator has full control over the system. If what
> you describe were possible, it would be an open invitation to every
> virus and trojan writer.
>
> If you are bent on doing this, google for "Sony rootkit" for some ideas
> (and legal ramifications).
Would it be illegal to lock all the files when the application is
running and allow it to be deleted when the process is down ?
| |
| adebaene@club-internet.fr 2006-01-30, 7:07 pm |
|
Sandeep wrote:
> I have a windows application ( VC++, COM) which we distribute through
> an Installer. I want to ensure that nobody can delete any of the files
> under our install directory manually. Only legal way would be to
> un-install the application. I was wondering how can I get a lock on a
> top level folder so that nothing can be deleted from it. Any thoughts ?
To complete Igor answer, what you can do is set the security rights
(DACL) on the top-level directory of your app so that the directory is
writeable only by administrators.
By default, if your program is installed under "c:\Program Files", only
administrators and power users hae the write right anyway.
Arnaud
MVP - VC
| |
| Igor Tandetnik 2006-01-30, 7:07 pm |
| Sandeep <sandeepsinghal@gmail.com> wrote:
> Igor Tandetnik wrote:
>
> Would it be illegal to lock all the files when the application is
> running and allow it to be deleted when the process is down ?
That's fine, you can do this. In fact, it happens automatically with EXE
and DLL files - you can't delete them while a process using them is
running. Of course, an administrator can always kill the process and
then delete the files.
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
|
|
|
|
|