ANN: Vista "Gotchas" You Should Know About

J. Landman Gay jacque at hyperactivesw.com
Fri Feb 23 18:03:36 EST 2007


I sent the following to the Improve list but forgot to copy it to this 
one, so am resending.

Some cursory searches on the web showed me that we aren't the only ones
wondering where to store writable files in Vista. There aren't a lot of
answers yet. Here are some excerpts I pasted into a text document from
various pages I found, in no particular order. Sorry, I didn't keep any
accredidations.

****
Re: Is there a "standard place" to store writeable not plublic shared
files to please UAC?

Hello guys,


Just to let you know I have been fighting through this same exact issue
for a few weeks.

Initially I tried to write our data to
CSIDL_COMMON_APPDATA\[ApplicationName]. This worked fine and allows
users to share files but as this post states this folder is considered a
system folder and is hidden by VISTA which means your users cannot share
their database or folder so that other users on the network can access
it. In order to do this your users have to show hidden system folders
and then share it. It is a huge pain.



So we shifted to CSIDL_COMMON_DOCUMENTS which actually maps to
c:\users\public\documents on VISTA and we placed a subfolder here. This
location is read/write by default and visible to all users. This worked
fantastic for us. I tested it on 2000, XP and VISTA and our install
worked excellent.

The problem is XP Server 2003 does not have a CSIDL_COMMON_DOCUMENTS
folder and our install is not working on xp server 2003 because of this.
  I am looking into this right now and I have heard it is because of the
version of the SHGETFOLDERPATH API that was shipped with this Operating
System.

With that one limitation right now we are completely up and running (I
am hoping to find a work around for this issue).

CSIDL_COMMON_DOCUMENTS lets you share data with users on the same
machine, users across the network and is visible to all users.

CSIDL_COMMON_APPDATA is practically useless because it is hidden in VISTA.

Also, even though MS lists the AppData folder as a "shared location" if
you try to write data here with an admin and a standard user you will
see that Virtualization will kick in and write this data to the local
user profile unless you specifically open permissions up on your
subfolder that you install under CSIDL_COMMON_APPDATA during your
installation.



My vote is for CSIDL_COMMON_DOCUMENTS and I would love to know
Microsofts answer to this.  When I asked them this:

"Where should we store machine wide data so it can be accessed by users
on the same machine and across the network"

They told me this:

"There is no officially published answer"



----------
 From MS Forum - AppData folder is not writable:

This note from the Microsoft site mentioned below, suggests that
application specific data should be placed in the location provided by
the KnownFolder API (passing parameter :CSIDL_COMMON_APPDATA).


CSIDL_COMMON_APPDATA
This folder should be used for application data that is not user
specific. For example, an application may store a spell check
dictionary, a database of clip-art or a log file in the
CSIDL_COMMON_APPDATA folder. This information will not roam and is
available to anyone using the computer. By default, this location is
read-only for normal (non-admin, non-power) Users. If an application
requires normal Users to have write access to an application specific
subdirectory of CSIDL_COMMON_APPDATA, then the application must
explicitly modify the security on that sub-directory during application
setup. The modified security must be documented in the Vendor Questionnaire.
http://msdn2.microsoft.com/en-us/library/ms995853.aspx

As stated, this location is read-only.


-------------

On Vista, with User Account Control disabled, there is no write and
execute access to the %TEMP% folder

---------------


I just found out the hard way that ...
Environment.SpecialFolder.CommonApplicationData that returns
"C:\Documents and Settings\All Users\Application Data" under XP that is
writeable for all users, returns "C:\ProgramData\" under Vista and this
is not writeable for regular users which is really killing me. In our
case this location could be hidden or not; it doesn't really matter.

Having a special folder that goes by the .Net enum
Environment.SpecialFolder.CommonApplicationData and not actually being
able to use it for Common Application Data without requiring admin
rights seems like a bit of a problem.

------------------

[Something to test:]

Have you considered that while "ProgramData" itself may not allow you to
put files there, you might be able to create a writeable folder
structure beneath it to hold your data files?  I think the general plan
is that you create a folder like:

<common app data>\<companyname>\<appname>\

.. and then store your files underneath that.

Even on XP I'm seeing results that indicate some complex folder security
is being applied in these cases, and the subfolder structure my programs
adds is allowing any-user to have file create/read/write access if I
take no special action regarding ACLs.

  -------------------


-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com



More information about the use-livecode mailing list