Re: Vista & UAC: where to place "common files"



The common, and correct, advice is to use SHGetSpecialFolderLocation to get
the correct place for files. COMMON_APPDATA is where your files belong

HOWEVER.

this advice is lies. its rubbish. Because the common files location problem
exists under all versions of Windows NT. In its default configuration, most
folders users can create files and folders in, including COMMON_APPDATA
gives fullaccess to the creator/owner, but other normal users typically get
read, but do not get write access. This means that the first user to create
a file gets RW access, everyone else gets r-only access.

Which means you are stuck using the security APIs on folder creation to
adjust the access list. You only need to do it once, when you first create
the root folder of your application store - once set up (properly) the
adjusted ACL gets applied to every file and sub folder created. So its best
done by a setup program.

And setup programs run elevated. Which means your setup program - by
definition - has the ability to use the same code to adjust the ACLs for
your program files folder. which means that you dont actually *need* to go
to COMMON_APPDATA, as the same code that fixes common app data fixes a
folder created under program files. Ironic.

The one thing I havnt found anywhere on the net is sample code demonstrating
the recommended way of adding all-user rw access to a folder.


"Mirek" <Mirek@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:D793B33F-1007-4966-8E8D-EC6522628BE5@xxxxxxxxxxxxxxxx
Hi,
We have several applications that require read/write access to some
"per-machine files", i.e. files that are common for all users of the
machine.
Our applications (especially trial versions) need to read and write some
data
to these files always at their startup. Before Vista we had these files in
a
special subdirectory - for example "C:\Program Files\MyApp\Authorization".
Now on Windows Vista we have to solve the problem with UAC when all files
under C:\Program Files are not accessible for writing for standard users.
My
question is: where should we place these files to make our program fully
compatible with Vista's UAC and Microsoft's "best practices"? Is there any
dedicated "known-folder" for things like this? I think that "public
documents", which is often shared on LAN, is not the best place for
authorization files. We neither want to change privileges of the
"Authorization" folder programmatically (this is what we do now as a
temporary solution). The virtual store is witched off in the manifest.

I think that there must be many companies with similar problems and
therefore I hope that Microsoft has a simple solution for this. Any idea
is
appreciated.
Thanks Mirek


.



Relevant Pages

  • Re: Create Linked Document Bundle
    ... I have another folder that contains 15 document templates. ... I open a new master document and enter the common data in a user form the ... Greg Maxey - Word MVP ... Word MVP web site http://word.mvps.org ...
    (microsoft.public.word.vba.general)
  • RE: Userform to obtain folder (path) info ?
    ... You can modify the Common dialog control to open up as a browse folder ... ByVal lpBuffer As String) As Long ... Dim lpIDList As Long ...
    (microsoft.public.word.vba.userforms)
  • Re: Vista & UAC: where to place "common files"
    ... access to read and write trusted executable files in your program files ... So I strongly recommend using those folders which are set up for COMMON ... Which means you are stuck using the security APIs on folder creation to ... Which means your setup program - by ...
    (microsoft.public.platformsdk.security)
  • Restricted user -> Common writable folder for all users (NT -> XP)?
    ... matter) that is common to all users of a PC. ... folder somewhere on a system that every user has access to and has rights to ... component updated (I didn't track down what exactly, it doesn't matter as I ... running into the same type of problem; in most cases a restricted user ...
    (microsoft.public.win2000.security)
  • Re: Start, All Programs
    ... folder that would start when Windows starts. ... folder, look around at the program shortcuts that are there, those should ... MS-MVP Windows Shell/User ... Common Start Menu REG_EXPAND_SZ %ALLUSERSPROFILE%\Start Menu ...
    (microsoft.public.windowsxp.general)