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. Install Files In Root Directory

Install Files In Root Directory

Scheduled Pinned Locked Moved C#
questiondiscussion
8 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.
  • B Offline
    B Offline
    BlitzPackage
    wrote on last edited by
    #1

    Good people, Quick question: Is it ok to install application files in the root directory (C:\My App\DataFiles.app)?   We have an application and I think the file should be installed in the SpecialFolder.ApplicationData path.   I always thought that the root directory should not be a place where app files should be deployed unless absolutely necessary. Let me know your thoughts? Thanks, Blitz

    L L B 4 Replies Last reply
    0
    • B BlitzPackage

      Good people, Quick question: Is it ok to install application files in the root directory (C:\My App\DataFiles.app)?   We have an application and I think the file should be installed in the SpecialFolder.ApplicationData path.   I always thought that the root directory should not be a place where app files should be deployed unless absolutely necessary. Let me know your thoughts? Thanks, Blitz

      L Offline
      L Offline
      Luc Pattyn
      wrote on last edited by
      #2

      IMO you should not do so. It gets messy pretty soon. AFAIK Vista and future Windows will prevent regular users from doing that anyhow. The app itself belongs somewhere under C:\Program Files\ using some folder hierarchy reflecting company and product name and possibly version. The data files your app needs could go in one of the special folders provided for such purpose. See Environment.GetFolderPath, and SpecialFolder.ApplicationData/CommonApplicationData. There too some folder hierarchy should be applied. And the user-visible files your app deals with (its documents) probably belong somewhere inside "My Documents" which also should be reached through the corresponding SpecialFolder. :)

      Luc Pattyn [Forum Guidelines] [My Articles]


      The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.


      B 1 Reply Last reply
      0
      • L Luc Pattyn

        IMO you should not do so. It gets messy pretty soon. AFAIK Vista and future Windows will prevent regular users from doing that anyhow. The app itself belongs somewhere under C:\Program Files\ using some folder hierarchy reflecting company and product name and possibly version. The data files your app needs could go in one of the special folders provided for such purpose. See Environment.GetFolderPath, and SpecialFolder.ApplicationData/CommonApplicationData. There too some folder hierarchy should be applied. And the user-visible files your app deals with (its documents) probably belong somewhere inside "My Documents" which also should be reached through the corresponding SpecialFolder. :)

        Luc Pattyn [Forum Guidelines] [My Articles]


        The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.


        B Offline
        B Offline
        BlitzPackage
        wrote on last edited by
        #3

        Thanks Luc, Where should the LogFile (of database errors) be placed?   We may need them to email it to us for support purposes. Thanks again, Blitz

        L 1 Reply Last reply
        0
        • B BlitzPackage

          Good people, Quick question: Is it ok to install application files in the root directory (C:\My App\DataFiles.app)?   We have an application and I think the file should be installed in the SpecialFolder.ApplicationData path.   I always thought that the root directory should not be a place where app files should be deployed unless absolutely necessary. Let me know your thoughts? Thanks, Blitz

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          I would be angry if a program would do that to me.. In fact, I have been angry for that reason quite often already. Both Java and nVidia see fit to place their crap in C:\

          1 Reply Last reply
          0
          • B BlitzPackage

            Thanks Luc, Where should the LogFile (of database errors) be placed?   We may need them to email it to us for support purposes. Thanks again, Blitz

            L Offline
            L Offline
            Luc Pattyn
            wrote on last edited by
            #5

            I guess your DB logfiles are common to all users, hence I would suggest SpecialFolder.CommonApplicationData; that is where I put user-agnostic logfiles. And I try and provide a command inside my app to explore that folder, or mail it to me, or whatever is appropriate; so the users don't have to explore their disk to get hold of it, and I don't have to explain the details in the documentation (since that folder may actually vary depending on the Windows version and some installation choices). :)

            Luc Pattyn [Forum Guidelines] [My Articles]


            The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.


            B 1 Reply Last reply
            0
            • B BlitzPackage

              Good people, Quick question: Is it ok to install application files in the root directory (C:\My App\DataFiles.app)?   We have an application and I think the file should be installed in the SpecialFolder.ApplicationData path.   I always thought that the root directory should not be a place where app files should be deployed unless absolutely necessary. Let me know your thoughts? Thanks, Blitz

              B Offline
              B Offline
              BlitzPackage
              wrote on last edited by
              #6

              Thanks to both of you. By the way, do you know where I can find documentation recommending against using the root directory.   The other programmer is a Java programmer and thinks that writing to the root directory is fine. Thanks again for your help, Blitz

              1 Reply Last reply
              0
              • L Luc Pattyn

                I guess your DB logfiles are common to all users, hence I would suggest SpecialFolder.CommonApplicationData; that is where I put user-agnostic logfiles. And I try and provide a command inside my app to explore that folder, or mail it to me, or whatever is appropriate; so the users don't have to explore their disk to get hold of it, and I don't have to explain the details in the documentation (since that folder may actually vary depending on the Windows version and some installation choices). :)

                Luc Pattyn [Forum Guidelines] [My Articles]


                The quality and detail of your question reflects on the effectiveness of the help you are likely to get. Show formatted code inside PRE tags, and give clear symptoms when describing a problem.


                B Offline
                B Offline
                BlitzPackage
                wrote on last edited by
                #7

                Luc, what would you do with the Log file? Thanks, Blitz

                1 Reply Last reply
                0
                • B BlitzPackage

                  Good people, Quick question: Is it ok to install application files in the root directory (C:\My App\DataFiles.app)?   We have an application and I think the file should be installed in the SpecialFolder.ApplicationData path.   I always thought that the root directory should not be a place where app files should be deployed unless absolutely necessary. Let me know your thoughts? Thanks, Blitz

                  L Offline
                  L Offline
                  Lost User
                  wrote on last edited by
                  #8

                  It would only be "fine" if the computer that hosts your application is a dedicated PC that will only be used with your application. If not, then try and integrate with the pre-existing environment; add applications where other applications are found, write docs to the place where documents go, and errors the the EventLog. Though it might sound insane to scatter all data over different folders, there is a rationale behind it. I regularly backup "My Documents", but I hardly ever backup "Program Files" or the crap that's in the root - having the same executable backed up over and over would be inefficient. The moment my PC stops working, the Admin remotely looks into the eventlog and mails me that I should not disable the Norton Antivirus-service. He puts back an image with my applications, and I restore my Documents. The need to put every existing folder in the PATH has gone. What argumentation is there left in favor of installing to the systemroot?

                  I are troll :)

                  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