Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. How to Compile an Application So that the Files in Application Folder are Delete-Protected

How to Compile an Application So that the Files in Application Folder are Delete-Protected

Scheduled Pinned Locked Moved C#
tutorialquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    thepolishguy
    wrote on last edited by
    #1

    Is there a way to compile an application so that the files included in the application folder cannot be delelted unless the user uninstalls the program? Or, at least, is there a way to protect certain files from being deleted that may be essential to the program's operation?

    K C 2 Replies Last reply
    0
    • T thepolishguy

      Is there a way to compile an application so that the files included in the application folder cannot be delelted unless the user uninstalls the program? Or, at least, is there a way to protect certain files from being deleted that may be essential to the program's operation?

      K Offline
      K Offline
      KaptinKrunch
      wrote on last edited by
      #2

      My idea would be to NTFS file permissions on those files that need protecting. Set it up so that only the administrator has delete privs. All others would have read and execute? How to do this from code you would need to do some googling.

      1 Reply Last reply
      0
      • T thepolishguy

        Is there a way to compile an application so that the files included in the application folder cannot be delelted unless the user uninstalls the program? Or, at least, is there a way to protect certain files from being deleted that may be essential to the program's operation?

        C Offline
        C Offline
        Curtis Schlak
        wrote on last edited by
        #3

        If the user installed your application using Windows Installer (i.e., your Setup project), then they can delete all the files that they want in the Program Files area as long as you follow one simple rule: install the shortcuts to the application through your Setup project and NOT through programmatic means. If you do this, then that shortcut the user clicks on the desktop or in the start menu actually starts a process that checks the manifest for their installed program. If any "Vital" files do not exist, then Windows Installer will automagically replace them! Isn't that nice.... "we must lose precision to make significant statements about complex systems." -deKorvin on uncertainty

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups