Subject | Re: [firebird-support] Embedded Firebird |
---|---|
Author | Dean Harding |
Post date | 2008-04-15T04:01:07Z |
Tomy Handaka wrote:
Vista that allows badly behaved applications (that assume they are
running with Administrator rights) to work even when not running as an
Administrator.
The way it works, basically, is that when you try to open a file under
"C:\Program Files" and request write access, if you do not have write
access to the file (i.e. you're not an Administrator) Windows will
create a "virtual" copy of the file under the VirtualStore directory in
your profile. It'll then grant you read/write access to the *virtual* copy.
The correct solution is to not create any files under "C:\Program Files"
that will be written to by your application. If you need to share data
between users (and do you *really* need to do that?) then create it
under the directory returned from:
Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData);
Dean.
> Yes, I am using Windows Vista. I noticed that it didn't happen on XP.It's called "File System Virtualization" and is a feature of Windows
> Could you please explain more detail about it? Or there is website that
> explain it technically?
>
> Physical FDB file:
>
> C:\Program Files\Terminal
>
> Virtual FDB File:
>
> C:\Users\<user>\AppData\Local\VirtualStore\Program Files\Terminal
>
> I wonder how Firebird/Vista create this file.
Vista that allows badly behaved applications (that assume they are
running with Administrator rights) to work even when not running as an
Administrator.
The way it works, basically, is that when you try to open a file under
"C:\Program Files" and request write access, if you do not have write
access to the file (i.e. you're not an Administrator) Windows will
create a "virtual" copy of the file under the VirtualStore directory in
your profile. It'll then grant you read/write access to the *virtual* copy.
The correct solution is to not create any files under "C:\Program Files"
that will be written to by your application. If you need to share data
between users (and do you *really* need to do that?) then create it
under the directory returned from:
Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData);
Dean.