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. Windows API
  4. Location for common data

Location for common data

Scheduled Pinned Locked Moved Windows API
windows-adminhelpquestionworkspace
7 Posts 4 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.
  • W Offline
    W Offline
    Winkles
    wrote on last edited by
    #1

    My app creates some common data that must be created only once and then be accessible by all users of the machine. I used to dump the data into the registry, but Vista foiled those plans by virtualizing the registry unless you had admin privileges, which meant the data was no longer common to all users. So I tried saving the data into the Environment.SpecialFolder.CommonApplicationData folder (which ends up pointing to C:\ProgramData). Foiled again! This folder also requires admin privileges if you are to avoid virtualization! Where can I save data that my app can use regardless of what user is signed on? Thanks for any help!

    D M J 3 Replies Last reply
    0
    • W Winkles

      My app creates some common data that must be created only once and then be accessible by all users of the machine. I used to dump the data into the registry, but Vista foiled those plans by virtualizing the registry unless you had admin privileges, which meant the data was no longer common to all users. So I tried saving the data into the Environment.SpecialFolder.CommonApplicationData folder (which ends up pointing to C:\ProgramData). Foiled again! This folder also requires admin privileges if you are to avoid virtualization! Where can I save data that my app can use regardless of what user is signed on? Thanks for any help!

      D Offline
      D Offline
      darkelv
      wrote on last edited by
      #2

      You can store in "Settings". Application Settings[^]

      W 1 Reply Last reply
      0
      • D darkelv

        You can store in "Settings". Application Settings[^]

        W Offline
        W Offline
        Winkles
        wrote on last edited by
        #3

        Thank you very much for your reply. I didn't know about Settings. Unfortunately it appears that application-scope settings are read-only, as mentioned in the first couple paragraphs of this page[^]. Is there really no official way of creating app data that is shared between all users?

        1 Reply Last reply
        0
        • W Winkles

          My app creates some common data that must be created only once and then be accessible by all users of the machine. I used to dump the data into the registry, but Vista foiled those plans by virtualizing the registry unless you had admin privileges, which meant the data was no longer common to all users. So I tried saving the data into the Environment.SpecialFolder.CommonApplicationData folder (which ends up pointing to C:\ProgramData). Foiled again! This folder also requires admin privileges if you are to avoid virtualization! Where can I save data that my app can use regardless of what user is signed on? Thanks for any help!

          M Offline
          M Offline
          Mark Salsbery
          wrote on last edited by
          #4

          The recommended thing to do is have your installer give your common app data folder the required permissions. This same requirement applied to Windows 2000/XP as well, and is documented in the Designed for Windows XP Application Specification 2.3 Document[^] (See section 3.0). Also section 2.3 of the Requirements for the Windows Vista Logo Program for Software[^] Here's a little bit more info on setting the ACL from code: Windows Vista : Application Certification and Compatibility: Test Case 15: Verify application installs to the correct folders by default (Req:2.3)[^] Mark

          Mark Salsbery Microsoft MVP - Visual C++ :java:

          W 1 Reply Last reply
          0
          • M Mark Salsbery

            The recommended thing to do is have your installer give your common app data folder the required permissions. This same requirement applied to Windows 2000/XP as well, and is documented in the Designed for Windows XP Application Specification 2.3 Document[^] (See section 3.0). Also section 2.3 of the Requirements for the Windows Vista Logo Program for Software[^] Here's a little bit more info on setting the ACL from code: Windows Vista : Application Certification and Compatibility: Test Case 15: Verify application installs to the correct folders by default (Req:2.3)[^] Mark

            Mark Salsbery Microsoft MVP - Visual C++ :java:

            W Offline
            W Offline
            Winkles
            wrote on last edited by
            #5

            I really appreciate it! I didn't know about having the installer set the permissions. I guess Vista is finally forcing me to do things right. :)

            M 1 Reply Last reply
            0
            • W Winkles

              I really appreciate it! I didn't know about having the installer set the permissions. I guess Vista is finally forcing me to do things right. :)

              M Offline
              M Offline
              Mark Salsbery
              wrote on last edited by
              #6

              Winkles wrote:

              I guess Vista is finally forcing me to do things right

              A lot of us :)

              Winkles wrote:

              having the installer set the permissions

              I didn't mention this, but the permissions can be set manually as well, of course. Cheers, Mark

              Mark Salsbery Microsoft MVP - Visual C++ :java:

              1 Reply Last reply
              0
              • W Winkles

                My app creates some common data that must be created only once and then be accessible by all users of the machine. I used to dump the data into the registry, but Vista foiled those plans by virtualizing the registry unless you had admin privileges, which meant the data was no longer common to all users. So I tried saving the data into the Environment.SpecialFolder.CommonApplicationData folder (which ends up pointing to C:\ProgramData). Foiled again! This folder also requires admin privileges if you are to avoid virtualization! Where can I save data that my app can use regardless of what user is signed on? Thanks for any help!

                J Offline
                J Offline
                James Lonero
                wrote on last edited by
                #7

                I haven't programmed in Vista for about 9 months. But if you want to store your data in the registry, if you place it into HKEY_LOCAL_MACHINE, vista will not allow that. It creates a copy in the current user's node only. Try using HKEY_ROOT instead. If you want to place the data on disk, Vista has a folder called Program Data, similar to Program Files. Place your data there instead of program files.

                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