Installing a database to be written to by all users

Hi,

I have searched on this topic but I still can't make head nor tail of it - I have spent a couple of hours again tonight surfing and reading microsoft papers. Many apologies if this has been explained many a time. I worked hard over the last two weeks to make alterations and its still virtualizing my files!

I use Visual Studio 2005 and its a fairly simple database driven app. At first I had all my data stored in the application directory. Then I came across some problem with users who had changed to Vista. Data went missing during an automatic app-upgrade. And so I was initiated into folder virtualization.

So I followed the Microsoft guides to write all user data as specified ..

'Write per-computer data to Users\All Users\Application Data:'

which I put into the deployment project of vs as [CommonAppDataFolder]...

..which ends up in 'programdata' and this seems to be correct. There is other application data in here (Adobe, etc).

However, this also gets virtualised which suprised me. The other applications data (Adobe) in this folder doesn't. Is there anyway I can stop this?

I could make a copy of this data to the User application data folder when a user first runs the app. So for each new user login, a copy is made for that user if the data doesn't already exist in their 'own' app data (is that whatthis thread is suggesting?). Or I could move it to the public documents (as inthis post) but I don't really want users to be able to access or see the data (only administrators).

I would really appreciate it if someone could point me in right direction.

Many thanks,

Jon.

[2038 byte] By [DreamState] at [2008-1-4]
# 1
So are you looking for techniques to manage common program data or common user data?
BruceN.Baker-MSFT at 2007-10-11 > top of Msdn Tech,Software Development for Windows Vista,Application Compatibility for Windows Vista...
# 2

Bruce,

Thanks for replying.

It was intended to be common user data but since writing the forum post I found a faq by another company which described how they had altered their app for Vista (it was information about a patch). So I used that as a template and have, I believe, sorted out the best way for me. As it happens, although I have always used the same data for all users (all users access the same databases) it is not critical, and it may be beneficial for them to have seperate databases anyway.

So the application installs as before and the databases are installed to the 'AllUsers' application folder ('ProgramData'). However, now when the app launches it checks to see if the databases exist for the current user (in the roaming folder for Vista). If they do not, it takes a copy of them from the 'AllUsers'.

This seems to me to satisfy the Vista requirements in that, as I understand it, the copy from the AllUsers will always have the appropriate permissions for the currently logged in user.

I have tested and have yet to see any virtualized folders!

Jon.

DreamState at 2007-10-11 > top of Msdn Tech,Software Development for Windows Vista,Application Compatibility for Windows Vista...
# 3
Good solution. Your there.
BruceN.Baker-MSFT at 2007-10-11 > top of Msdn Tech,Software Development for Windows Vista,Application Compatibility for Windows Vista...

Software Development for Windows Vista

Site Classified