Hi,
I am having a problem understanding the Win7 UAC Data Redirection rules and/or intent.
Our installer puts data files in the Common App Data tree (in Win7 that is C:\ProgramData\[CompanyName]\[ProductName]\[ProductVersion]). That is all going fine, except when I install an update to our system to go (say) from v130844 to v130855, then I am running into a problem.
When a limited user launches our application if their %appdata% tree doesn't have the latest data files that are stored in the Common App Data tree then we copy the files from their into the user's %appdata% tree (C:\Users\[Username]\AppData\Roaming\[CompanyName]\[ProductName]\[ProductVersion]). The reason for this is our installer puts the latest version of these data files in Common App Data, so that when other non-Admin users launch the app then that folder will be the source folder for these latest data files.
e.g.
FileCopy C:\ProgramData\[CompanyName]\[ProductName]\[ProductVersion]\file1, C:\Users\[Username]\AppData\Roaming\[CoName]\[ProductName]\[ProductVersion]\file1
FileCopy C:\ProgramData\[CompanyName]\[ProductName]\[ProductVersion]\file2, C:\Users\[Username]\AppData\Roaming\[CoName]\[ProductName]\[ProductVersion]\file2
etc.
To find the actual folder names we make calls to the SHGetFolderPath API using the CSIDL_COMMON_APPDATA and CSIDL_APPDATA constants.
What I am finding is that the file1 in the %appdata% tree is not the version of file that is expected. If I look at the file timestamp of file1 in the Common App Data tree it is 1/2/2014 3:40pm, but the file that is ending up in the %appdata% tree is dated 1/1/2014 11:40am which happens to correspond with the timestamp of the file in C:\Users\[Username]\AppData\Local\VritualStore\ProgramData\[CoName]\[ProductName]\[ProductVersion]\file1
So it seems that Win7 is doing some data redirection for me...but how do go about fixing it so that the file1 is sourced from Common App Data tree? Or what are my other options to fix this?
Thanks.
FOLLOW US
Get the latest news in Application Packaging