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. Vista - Program Data Directory

Vista - Program Data Directory

Scheduled Pinned Locked Moved Windows API
helpquestionannouncement
6 Posts 3 Posters 8 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.
  • S Offline
    S Offline
    Storm blade
    wrote on last edited by
    #1

    I have a program that has some data files in the "Applications Data" directory (now called Program Data in vista). When it modifies those files, instead of modifying the original files, Vista creates a new copy of the files in another Program Data directory in the users account... But, if I then Update the original files, the out of date 'user' copies of the files still exist, and are used instead of the up to date files. Isn't this a bug? The whole point of the All user application data directory is for the application to store data available for all the users, and if it wants data just for the current user, it stores that in the current users application data directory. But Vista now doesn't let you store data accessable by all the users of a program...

    T M 2 Replies Last reply
    0
    • S Storm blade

      I have a program that has some data files in the "Applications Data" directory (now called Program Data in vista). When it modifies those files, instead of modifying the original files, Vista creates a new copy of the files in another Program Data directory in the users account... But, if I then Update the original files, the out of date 'user' copies of the files still exist, and are used instead of the up to date files. Isn't this a bug? The whole point of the All user application data directory is for the application to store data available for all the users, and if it wants data just for the current user, it stores that in the current users application data directory. But Vista now doesn't let you store data accessable by all the users of a program...

      T Offline
      T Offline
      TheCodeKing
      wrote on last edited by
      #2

      This is happening because your application is not 'Vista Aware'. I'm planning on writing an article on this shortly. In brief... to make your application Vista aware you need to add a manifest. If you don't do this Vista will virtualize the Program Data folders and the registry writes. This means instead of reading and writing to the real locations, it creates a virtual copy under the user account.

      http://www.TheCodeKing.co.uk

      S 1 Reply Last reply
      0
      • T TheCodeKing

        This is happening because your application is not 'Vista Aware'. I'm planning on writing an article on this shortly. In brief... to make your application Vista aware you need to add a manifest. If you don't do this Vista will virtualize the Program Data folders and the registry writes. This means instead of reading and writing to the real locations, it creates a virtual copy under the user account.

        http://www.TheCodeKing.co.uk

        S Offline
        S Offline
        Storm blade
        wrote on last edited by
        #3

        Ok, Thanks. It still sounds wrong.... Any pointers to adding this vista aware manifest under VC++6? I presume it is a modified version of the one you use to get the XP style controls.

        T 1 Reply Last reply
        0
        • S Storm blade

          Ok, Thanks. It still sounds wrong.... Any pointers to adding this vista aware manifest under VC++6? I presume it is a modified version of the one you use to get the XP style controls.

          T Offline
          T Offline
          TheCodeKing
          wrote on last edited by
          #4

          I've only done this in managed applications for which there's a command line tool called mt.exe. The manifest looks something like this:

          <?xml version="1.0" encoding="utf-8" ?>
          <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
          <assemblyIdentity version="1.0.0.0" processorArchitecture="X86" name="Test" type="win32" />
          <description>Test Application</description>
          <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
          <security>
          <requestedPrivileges>
          <requestedExecutionLevel level="asInvoker" />
          </requestedPrivileges>
          </security>
          </trustInfo>
          </assembly>

          I think in VC++6 it will be the same process as for adding the XP styles. Basically adding it as a embedded resource.


          TheCodeKing.co.uk

          T 1 Reply Last reply
          0
          • S Storm blade

            I have a program that has some data files in the "Applications Data" directory (now called Program Data in vista). When it modifies those files, instead of modifying the original files, Vista creates a new copy of the files in another Program Data directory in the users account... But, if I then Update the original files, the out of date 'user' copies of the files still exist, and are used instead of the up to date files. Isn't this a bug? The whole point of the All user application data directory is for the application to store data available for all the users, and if it wants data just for the current user, it stores that in the current users application data directory. But Vista now doesn't let you store data accessable by all the users of a program...

            M Offline
            M Offline
            Michael Dunn
            wrote on last edited by
            #5

            Check the ACLs on the file(s). If your app runs as User1 and created a file there, then you run the app as User2, User2 won't have write privs to the file. You'll need to set the ACLs on the file at the time you create it - for example, give the Users group full control.

            --Mike-- Visual C++ MVP :cool: LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ Ford, what's this fish doing in my ear?

            1 Reply Last reply
            0
            • T TheCodeKing

              I've only done this in managed applications for which there's a command line tool called mt.exe. The manifest looks something like this:

              <?xml version="1.0" encoding="utf-8" ?>
              <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
              <assemblyIdentity version="1.0.0.0" processorArchitecture="X86" name="Test" type="win32" />
              <description>Test Application</description>
              <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
              <security>
              <requestedPrivileges>
              <requestedExecutionLevel level="asInvoker" />
              </requestedPrivileges>
              </security>
              </trustInfo>
              </assembly>

              I think in VC++6 it will be the same process as for adding the XP styles. Basically adding it as a embedded resource.


              TheCodeKing.co.uk

              T Offline
              T Offline
              TheCodeKing
              wrote on last edited by
              #6

              Finally got around to writting an article about this, might help understand why it happens.


              TheCodeKing.co.uk

              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