You should not put database files in the "Program Files" folder. The
"Program Files" folder is for binaries, libraries, and resource files. The
contents of "Program Files" should never change unless you are installing,
removing, or patching a program.
If your database will be shared across multiple users, it should go in the
all users appdata directory, which looks something like: "C:\Documents and
Settings\All Users\yourprogram". In Windows Vista, the default location for
this folder has been moved to "C:\ProgramData\yourprogram" but there is a
symbolic link to the old location to accommodate software which incorrectly
hard-coded the old pathname. (Of course, you should not hardcode these
pathnames because users can install the OS to a different drive -- instead
call a function similar to SHGetKnownFolderPath)
PS: This has nothing to do with UAC -- even if you turn off UAC you will
still see this behavior. The Program Files redirection feature mentioned by
the previous poster makes it possible for sysadmins to lock down permissions
on application binaries, while working around the broken behavior of
programs that write data to "Program Files". (You wouldn't put a database in
/usr/bin on a UNIX system, would you?) Unless you're updating your binaries,
there has been no need to write to "Program Files" since Windows 98 came out
11 years ago...
From: Eduardo Castro [mailto:email@example.com]
Sent: Thursday, April 09, 2009 1:17 PM
Subject: Question about file permission
I have an application that uses Derby and it is installed in the
Program Files folder. To install the application, it is required an
administrator user. However, after installing, if a non administrator user
tries starting the application, it can not write to the derby database, just
read. This app is shared by multiple users, non-administrator users.
Any suggestions to avoid this problem with permissions?
OS: Windows Vista