views:

1196

answers:

2

I have an app modified to take into account the UAC in VISTA. So, now, the .mdb (JET or Access file) is located in ProgramData\MyApp\

I realized that when my app reads the database for the first time it is doing it from that location... but when my app is writting to the database... the file is virtualized and goes to Users\MyUser\AppData\Local\VirtualStore\ProgramData\MyApp. From this moment on my app always go to the Virtualized location in disk.

My app is working, but if I continue this way, the database would be in a per-user basis, and we really need sharing the database with all the users in the PC.

I thought that writting under ProgramData folder would't trigger the virtualization mechanism.

What I'm missing?

I need to set the permissions for MyApp folder under ProgramData??

How can I do that on Install time?

Thanks people...

More info: Developed with VS2003 VB.NET using the VS Setup Project.

A: 

I have had trouble here as well, it seems vista once is decides to virtualize the file, the only way to stop it is to delete the virtual file. The next time you use it, it will use the ProgramData folder.

+1  A: 

Most likely you'll need to set write permissions for all users during installation.

To test, delete the virtualized folder, manually set the permissions on the ProgramData\MyApp folder and files and see if that works.

As for how to do that pragmatically during installation, that really depends on what technology you're using.

sascha
Yeap, it was just the write permission. The Other tricky thing is that doing a MSI from VS 2003 Setup Project, and using Custom Action (to set the folder permissions) causes errors in Vista because CustomActions run as a common user insted as the Elevated user which is running the Setup. You have to edit the MSI file with ORCA to set the flag of "No Impersonate" in true. To do so, in the Custom Action table, in the Type column of the "install" row you should set 3073 as the value.
Romias
Ah, setup projects from a pre-vista version of VS. Ugh. If you're savvy enough to use Orca then you're probably ready to graduate to using WiX which will make your life a whoooole lot easier :)
sascha