Vista - Program Data Directory
-
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...
-
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...
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.
-
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.
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.
-
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.
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.
-
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...
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?
-
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.
Finally got around to writting an article about this, might help understand why it happens.